v1.0 release

This commit is contained in:
Cameron
2024-08-27 03:29:38 -05:00
parent a4403ce17b
commit ef7c3f9dbd
38 changed files with 1172 additions and 73 deletions

View File

@@ -35,6 +35,9 @@ namespace ComiServ
public DbSet<ComicAuthor> ComicAuthors { get; set; }
public DbSet<Author> Authors { get; set; }
public DbSet<Cover> Covers { get; set; }
public DbSet<User> Users { get; set; }
public DbSet<UserType> UserTypes { get; set; }
public DbSet<ComicRead> ComicsRead { get; set; }
public ComicsContext(DbContextOptions<ComicsContext> options)
: base(options)
{
@@ -48,6 +51,17 @@ namespace ComiServ
modelBuilder.Entity<ComicAuthor>().ToTable("ComicAuthors");
modelBuilder.Entity<Author>().ToTable("Authors");
modelBuilder.Entity<Cover>().ToTable("Covers");
modelBuilder.Entity<User>().ToTable("Users");
modelBuilder.Entity<UserType>().ToTable("UserTypes")
.HasData(
Enum.GetValues(typeof(UserTypeEnum))
.Cast<UserTypeEnum>()
.Select(e => new UserType()
{
Id = e,
Name = e.ToString()
})
);
}
/// <summary>
/// puts a user-provided handle into the proper form