Implemented category feature
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
namespace LiteCharms.Features.MidrandBooks.Categories.Entities;
|
||||
|
||||
[EntityTypeConfiguration<CategoryConfiguration, Category>]
|
||||
public sealed class Category : Models.Category;
|
||||
@@ -0,0 +1,14 @@
|
||||
namespace LiteCharms.Features.MidrandBooks.Categories.Entities;
|
||||
|
||||
public sealed class CategoryConfiguration : IEntityTypeConfiguration<Category>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Category> builder)
|
||||
{
|
||||
builder.ToTable("Categories");
|
||||
|
||||
builder.HasKey(c => c.Id);
|
||||
builder.Property(c => c.Name).IsRequired().HasMaxLength(15);
|
||||
builder.Property(c => c.IsMain).HasDefaultValue(false);
|
||||
builder.Property(c => c.Enabled).HasDefaultValue(true);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user