Good structure so far
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace Printbase.Infrastructure.DbEntities.Products;
|
||||
|
||||
[Table("ProductGroups")]
|
||||
[Index(nameof(Name), IsUnique = true)]
|
||||
public class ProductGroupDbEntity
|
||||
{
|
||||
[Key, Required]
|
||||
@@ -16,5 +18,13 @@ public class ProductGroupDbEntity
|
||||
public string? Description { get; set; }
|
||||
|
||||
[InverseProperty(nameof(ProductTypeDbEntity.Group)), Required]
|
||||
public required ICollection<ProductTypeDbEntity> Types { get; set; }
|
||||
public required ICollection<ProductTypeDbEntity> Types { get; set; } = [];
|
||||
|
||||
[Required]
|
||||
public DateTime CreatedAt { get; set; } = DateTime.UtcNow;
|
||||
|
||||
public DateTime? UpdatedAt { get; set; }
|
||||
|
||||
[Required]
|
||||
public bool IsActive { get; set; } = true;
|
||||
}
|
||||
Reference in New Issue
Block a user