Sample ASP.NET Core 6.0 reference application, powered by Microsoft, demonstrating a layered application architecture with monolithic deployment model. Download the eBook PDF from docs folder.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

31 lines
914 B

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using Microsoft.eShopWeb.ApplicationCore.Entities.OrderAggregate;
namespace Microsoft.eShopWeb.Infrastructure.Data.Config
{
public class AddressConfiguration : IEntityTypeConfiguration<Address>
{
public void Configure(EntityTypeBuilder<Address> builder)
{
builder.Property(a => a.ZipCode)
.HasMaxLength(18)
.IsRequired();
builder.Property(a => a.Street)
.HasMaxLength(180)
.IsRequired();
builder.Property(a => a.State)
.HasMaxLength(60);
builder.Property(a => a.Country)
.HasMaxLength(90)
.IsRequired();
builder.Property(a => a.City)
.HasMaxLength(100)
.IsRequired();
}
}
}