Refactored database registration to allow postgres to use internal representations for afster performance
This commit is contained in:
@@ -14,9 +14,10 @@ public sealed class ProductConfiguration : IEntityTypeConfiguration<Product>
|
||||
builder.Property(f => f.Summary).IsRequired().HasMaxLength(512);
|
||||
builder.Property(f => f.Description).HasMaxLength(1024);
|
||||
builder.Property(f => f.ImageUrl).HasMaxLength(1024);
|
||||
builder.Property(f => f.ThumbnailUrls).IsRequired(false).HasColumnType("jsonb");
|
||||
builder.Property(f => f.Metadata).IsRequired(false).HasColumnType("jsonb");
|
||||
builder.Property(f => f.Categories).IsRequired(false).HasColumnType("jsonb");
|
||||
builder.Property(f => f.Enabled).HasDefaultValue(false);
|
||||
builder.Property(f => f.Categories).IsRequired(false);
|
||||
builder.Property(f => f.ThumbnailUrls).IsRequired(false);
|
||||
|
||||
builder.OwnsOne(f => f.Metadata, b => { b.ToJson(); });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
[EntityTypeConfiguration<ProductPriceConfiguration, ProductPrice>]
|
||||
public class ProductPrice : Models.ProductPrice
|
||||
{
|
||||
public virtual Product Product { get; set; } = new();
|
||||
public virtual Product? Product { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user