public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <PhoneNumber>(); var contactConfiguration = modelBuilder.Entity <Contact>(); contactConfiguration.HasRequired(i => i.Person).WithMany(); contactConfiguration.HasMany(i => i.PhoneNumbers).WithOptional(); }
public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <Tournament>(); modelBuilder.Entity <Registrant>() .HasMany(i => i.Divisions).WithMany(); modelBuilder.Entity <TournamentSeries>(); modelBuilder.Entity <Division>(); modelBuilder.Entity <Registration>(); }
public static void OnApplicationStart(this IModelBuilder modelBuilder) { modelBuilder .Entity <AccountType>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <AccountType>() .Property(x => x.Id) .IsId(); modelBuilder .Entity <Ledger>() .Property(x => x.AccountName) .IsSearchColumn(); modelBuilder .Entity <LedgerGroup>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <MeasurementUnit>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <Product>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <ProductSubCategory>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <ProductCategory>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder .Entity <TaxCategory>() .Property(x => x.Name) .IsSearchColumn(); modelBuilder. Entity <VoucherEntry>() .Property(x => x.VoucherDetails) .Ignore(); }
public static void OnApplicationStart(this IModelBuilder modelBuilder) { modelBuilder .Entity <User>() .HasTableName("Users") .Property(x => x.Id) .IsId(); modelBuilder .Entity <UserCredential>() .HasTableName("Users") .Property(x => x.Id) .IsId(); }
public static void OnApplicationStart(this IModelBuilder modelBuilder) { modelBuilder .Entity <City>() .Property(x => x.Id) .IsId(); modelBuilder .Entity <State>() .Property(x => x.Id) .IsId(); modelBuilder .Entity <Country>() .Property(x => x.Id) .IsId(); }
public override void OnModelCreating(IModelBuilder builder) { builder.Entity <Product>() .HasKey(k => k.Id); builder.Entity <MySimpleEntity>() .HasProperty(e => e.Products) .Ignore(); builder.Entity <Product>() .HasProperty(p => p.Entity) .Ignore(); builder.Entity <MySimpleEntity>() .HasKey(k => k.Id); builder.Entity <MySimpleEntity>() .HasMany(k => k.Products) .WithOne(c => c.Entity) .HasForeignKey(c => c.EntityId); }
public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <Person>(); }
public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <WebPage>(); }
public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <User>(); modelBuilder.Entity <Role>(); }
public void Build(IModelBuilder modelBuilder) { modelBuilder.Entity <Member>(); modelBuilder.Entity <Club>(); modelBuilder.Entity <Rank>(); }
private TableSchema <T> GetTableSchema <T>() { var entitySchema = modelBuilder.Entity <T>() as EntitySchema <T>; return(entitySchema.BuildSchema(metadataProvider)); }