Ejemplo n.º 1
0
        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>();
 }
Ejemplo n.º 3
0
        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();
        }
Ejemplo n.º 5
0
        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();
        }
Ejemplo n.º 6
0
        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);
        }
Ejemplo n.º 7
0
 public void Build(IModelBuilder modelBuilder)
 {
     modelBuilder.Entity <Person>();
 }
Ejemplo n.º 8
0
 public void Build(IModelBuilder modelBuilder)
 {
     modelBuilder.Entity <WebPage>();
 }
Ejemplo n.º 9
0
 public void Build(IModelBuilder modelBuilder)
 {
     modelBuilder.Entity <User>();
     modelBuilder.Entity <Role>();
 }
Ejemplo n.º 10
0
 public void Build(IModelBuilder modelBuilder)
 {
     modelBuilder.Entity <Member>();
     modelBuilder.Entity <Club>();
     modelBuilder.Entity <Rank>();
 }
Ejemplo n.º 11
0
        private TableSchema <T> GetTableSchema <T>()
        {
            var entitySchema = modelBuilder.Entity <T>() as EntitySchema <T>;

            return(entitySchema.BuildSchema(metadataProvider));
        }