Esempio n. 1
0
 public MealMapping(Microsoft.Data.Entity.Metadata.Builders.EntityTypeBuilder <Meal> entityBuilder)
 {
     entityBuilder.HasKey(x => x.Id);
     entityBuilder.Property(x => x.Name).IsRequired().HasColumnType("varchar(60)");
     entityBuilder.Property(x => x.Price).IsRequired().HasColumnType("decimal");
     entityBuilder.HasOne(x => x.Category).WithMany();
 }
Esempio n. 2
0
 public OrderItemMapping(Microsoft.Data.Entity.Metadata.Builders.EntityTypeBuilder <OrderItems> entityBuilder)
 {
     entityBuilder.HasKey(x => x.ID);
     entityBuilder.Property(x => x.Quantity).IsRequired().HasColumnType("decimal");
     entityBuilder.HasOne(x => x.Meal).WithMany().IsRequired();
 }