From 382156d136cab28bf3472fa21048fc09a32ed841 Mon Sep 17 00:00:00 2001 From: Steven Hildreth Date: Fri, 2 Nov 2018 17:20:36 -0500 Subject: [PATCH] WIP --- RoadieLibrary/Data/Artist.cs | 6 ++++ RoadieLibrary/Data/ArtistAssociation.cs | 25 +++++++++++++++ RoadieLibrary/Data/ArtistGenre.cs | 25 +++++++++++++++ RoadieLibrary/Data/Bookmark.cs | 23 ++++++++++++++ RoadieLibrary/Data/IRoadieDbContext.cs | 14 +++++++++ RoadieLibrary/Data/Image.cs | 2 +- RoadieLibrary/Data/Release.cs | 2 ++ RoadieLibrary/Data/Request.cs | 21 +++++++++++++ RoadieLibrary/Data/RoadieDbContext.cs | 33 ++++++++++++++++++++ RoadieLibrary/Data/Submission.cs | 14 +++++++++ RoadieLibrary/Data/UserArtist.cs | 31 ++++++++++++++++++ RoadieLibrary/Data/UserRelease.cs | 31 ++++++++++++++++++ RoadieLibrary/Data/UserTrack.cs | 38 +++++++++++++++++++++++ RoadieLibrary/Enums/ArtistType.cs | 2 +- RoadieLibrary/Enums/BandStatus.cs | 3 +- RoadieLibrary/Enums/BookmarkType.cs | 1 + RoadieLibrary/Enums/RequestStatus.cs | 2 +- RoadieLibrary/Identity/ApplicationRole.cs | 3 ++ RoadieLibrary/Identity/ApplicationUser.cs | 18 +++++++++-- RoadieLibrary/Identity/UsersInRoles.cs | 3 ++ 20 files changed, 291 insertions(+), 6 deletions(-) create mode 100644 RoadieLibrary/Data/ArtistAssociation.cs create mode 100644 RoadieLibrary/Data/ArtistGenre.cs create mode 100644 RoadieLibrary/Data/Bookmark.cs create mode 100644 RoadieLibrary/Data/Request.cs create mode 100644 RoadieLibrary/Data/Submission.cs create mode 100644 RoadieLibrary/Data/UserArtist.cs create mode 100644 RoadieLibrary/Data/UserRelease.cs create mode 100644 RoadieLibrary/Data/UserTrack.cs diff --git a/RoadieLibrary/Data/Artist.cs b/RoadieLibrary/Data/Artist.cs index b70f4fa..d9ce17e 100644 --- a/RoadieLibrary/Data/Artist.cs +++ b/RoadieLibrary/Data/Artist.cs @@ -16,6 +16,8 @@ namespace Roadie.Library.Data [Column("artistType", TypeName = "enum")] public string ArtistType { get; set; } + public ICollection AssociatedArtists { get; set; } + [Column("bandStatus", TypeName = "enum")] public BandStatus? BandStatus { get; set; } @@ -30,6 +32,10 @@ namespace Roadie.Library.Data [MaxLength(50)] public string DiscogsId { get; set; } + public ICollection Genres { get; set; } + + public ICollection Images { get; set; } + [Column("isniList", TypeName = "text")] [MaxLength(65535)] public string ISNIList { get; set; } diff --git a/RoadieLibrary/Data/ArtistAssociation.cs b/RoadieLibrary/Data/ArtistAssociation.cs new file mode 100644 index 0000000..76bb657 --- /dev/null +++ b/RoadieLibrary/Data/ArtistAssociation.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Roadie.Library.Data +{ + [Table("artistAssociation")] + public partial class ArtistAssociation + { + public Artist Artist { get; set; } + + [Column("artistId")] + [Required] + public int ArtistId { get; set; } + + public Artist AssociatedArtist { get; set; } + + [Column("associatedArtistId")] + [Required] + public int AssociatedArtistId { get; set; } + + [Key] + [Column("id")] + public int Id { get; set; } + } +} \ No newline at end of file diff --git a/RoadieLibrary/Data/ArtistGenre.cs b/RoadieLibrary/Data/ArtistGenre.cs new file mode 100644 index 0000000..20aa60b --- /dev/null +++ b/RoadieLibrary/Data/ArtistGenre.cs @@ -0,0 +1,25 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Roadie.Library.Data +{ + [Table("artistGenreTable")] + public partial class ArtistGenre + { + public Artist Artist { get; set; } + + [Column("artistId")] + [Required] + public int ArtistId { get; set; } + + public Genre Genre { get; set; } + + [Column("genreId")] + [Required] + public int GenreId { get; set; } + + [Column("id")] + [Key] + public int Id { get; set; } + } +} \ No newline at end of file diff --git a/RoadieLibrary/Data/Bookmark.cs b/RoadieLibrary/Data/Bookmark.cs new file mode 100644 index 0000000..a215da0 --- /dev/null +++ b/RoadieLibrary/Data/Bookmark.cs @@ -0,0 +1,23 @@ +using Roadie.Library.Enums; +using Roadie.Library.Identity; +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Roadie.Library.Data +{ + [Table("bookmark")] + public partial class Bookmark : EntityBase + { + [Column("bookmarkTargetId")] + public int BookmarkTargetId { get; set; } + + [Column("bookmarkType")] + public BookmarkType? BookmarkType { get; set; } + + [Column("userId")] + [Required] + public int UserId { get; set; } + + public ApplicationUser User { get; set; } + } +} \ No newline at end of file diff --git a/RoadieLibrary/Data/IRoadieDbContext.cs b/RoadieLibrary/Data/IRoadieDbContext.cs index 834d31f..148dd76 100644 --- a/RoadieLibrary/Data/IRoadieDbContext.cs +++ b/RoadieLibrary/Data/IRoadieDbContext.cs @@ -1,17 +1,31 @@ using Microsoft.EntityFrameworkCore; +using Roadie.Library.Identity; namespace Roadie.Library.Data { public interface IRoadieDbContext { + DbSet ArtistAssociations { get; set; } + DbSet ArtistGenres { get; set; } DbSet Artists { get; set; } + DbSet Bookmarks { get; set; } DbSet CollectionReleases { get; set; } DbSet Collections { get; set; } + DbSet Genres { get; set; } + DbSet Images { get; set; } DbSet