Browse Source

Setting attributees to required

- This is because they currently do not allow nulls and we don't want to lose that
main
Eric Fleming 7 years ago
parent
commit
9ba78f5187
  1. 2
      src/Infrastructure/Data/CatalogContext.cs

2
src/Infrastructure/Data/CatalogContext.cs

@ -37,6 +37,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
private void ConfigureBasketItem(EntityTypeBuilder<BasketItem> builder) private void ConfigureBasketItem(EntityTypeBuilder<BasketItem> builder)
{ {
builder.Property(bi => bi.UnitPrice) builder.Property(bi => bi.UnitPrice)
.IsRequired(true)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
} }
@ -148,6 +149,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
builder.OwnsOne(i => i.ItemOrdered); builder.OwnsOne(i => i.ItemOrdered);
builder.Property(oi => oi.UnitPrice) builder.Property(oi => oi.UnitPrice)
.IsRequired(true)
.HasColumnType("decimal(18,2)"); .HasColumnType("decimal(18,2)");
} }
} }

Loading…
Cancel
Save