示例#1
0
        public MenuMapping(Microsoft.Data.Entity.Metadata.Builders.EntityTypeBuilder <Menu> entityBuilder)
        {
            entityBuilder.HasKey(x => x.ID);
            entityBuilder.Property(x => x.Day).IsRequired().HasColumnType("int");

            entityBuilder.HasMany(x => x.Items).WithOne().IsRequired();
        }
示例#2
0
        public OrderMapping(Microsoft.Data.Entity.Metadata.Builders.EntityTypeBuilder <Order> entityBuilder)
        {
            entityBuilder.HasKey(x => x.ID);
            entityBuilder.Property(x => x.Price).IsRequired().HasColumnType("decimal");
            entityBuilder.Property(x => x.TableNumber).HasColumnType("int").IsRequired();
            entityBuilder.Property(x => x.Status).HasColumnType("int").IsRequired();

            entityBuilder.HasMany(x => x.Items).WithOne().IsRequired();
        }