c# Programming Glossary: modelbuilder
Ignoring a class property in Entity Framework 4.1 Code First http://stackoverflow.com/questions/10385248/ignoring-a-class-property-in-entity-framework-4-1-code-first protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Customer .Ignore t t.LastName base.OnModelCreating.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Customer .Ignore t t.LastName base.OnModelCreating modelBuilder.. Customer .Ignore t t.LastName base.OnModelCreating modelBuilder http msdn.microsoft.com en us library hh295847 v vs.103 .aspx..
Entity Framework code first many-to-many mapping table http://stackoverflow.com/questions/11382783/entity-framework-code-first-many-to-many-mapping-table protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Recipe .HasMany x x.Members .WithMany x.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Recipe .HasMany x x.Members .WithMany x x.Recipes .Map.. too it's the same just another side of the same coin modelBuilder.Entity Member .HasMany x x.Recipes .WithMany x x.Members .Map..
How to create custom additional fields in UserProfile in MVC4 http://stackoverflow.com/questions/12435252/how-to-create-custom-additional-fields-in-userprofile-in-mvc4 set protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Conventions.Remove PluralizingTableNameConvention.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Conventions.Remove PluralizingTableNameConvention Added the..
Soft Delete Entity Framework Code First http://stackoverflow.com/questions/12698793/soft-delete-entity-framework-code-first protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Foo .Map m m.Requires IsDeleted .HasValue.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Foo .Map m m.Requires IsDeleted .HasValue false modelBuilder.Entity.. Foo .Map m m.Requires IsDeleted .HasValue false modelBuilder.Entity Bar .Map m m.Requires IsDeleted .HasValue false It's..
Entity Framework Code First: decimal precision and scale http://stackoverflow.com/questions/3504660/entity-framework-code-first-decimal-precision-and-scale void OnModelCreating System.Data.Entity.DbModelBuilder modelBuilder modelBuilder.Entity Class .Property object object.property .HasPrecision.. System.Data.Entity.DbModelBuilder modelBuilder modelBuilder.Entity Class .Property object object.property .HasPrecision..
EF4 Code First: how to add a relationship without adding a navigation property http://stackoverflow.com/questions/5217441/ef4-code-first-how-to-add-a-relationship-without-adding-a-navigation-property System.Data.Entity.ModelConfiguration.ModelBuilder modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity User.. modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity User .HasRequired r r.Role .WithMany .HasForeignKey.. modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity User .HasRequired r r.Role .WithMany .HasForeignKey..
What is the difference between static methods in a Non static class and static methods in a static class? http://stackoverflow.com/questions/5241899/what-is-the-difference-between-static-methods-in-a-non-static-class-and-static-m
Does Entity Framework 4 Code First have support for identity generators like NHibernate? http://stackoverflow.com/questions/5275306/does-entity-framework-4-code-first-have-support-for-identity-generators-like-nhi protected override void OnModelCreating ModelBuilder modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity MyEntity.. ModelBuilder modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity MyEntity .HasKey e e.Id Turn off autogeneration.. modelBuilder base.OnModelCreating modelBuilder modelBuilder.Entity MyEntity .HasKey e e.Id Turn off autogeneration in database..
Entity Framework Code First - two Foreign Keys from same table http://stackoverflow.com/questions/5559043/entity-framework-code-first-two-foreign-keys-from-same-table ... protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Match .HasRequired m m.HomeTeam .WithMany.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Match .HasRequired m m.HomeTeam .WithMany t t.HomeMatches.. .HasForeignKey m m.HomeTeamId .WillCascadeOnDelete false modelBuilder.Entity Match .HasRequired m m.GuestTeam .WithMany t t.AwayMatches..
How do I prevent decimal values from being truncated to 2 places on save using the EntityFramework 4.1 CodeFirst? [duplicate] http://stackoverflow.com/questions/6629263/how-do-i-prevent-decimal-values-from-being-truncated-to-2-places-on-save-using-t set protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Metrics .Property x x.PPM .HasPrecision.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Entity Metrics .Property x x.PPM .HasPrecision 4 3 share improve..
ef code first: get entity table name without dataannotations http://stackoverflow.com/questions/7008212/ef-code-first-get-entity-table-name-without-dataannotations is protected override void OnModelCreating DbModelBuilder modelBuilder model mappings base.OnModelCreating modelBuilder table mapping.. modelBuilder model mappings base.OnModelCreating modelBuilder table mapping var config modelBuilder.Configurations .GetPrivateFieldValue.. base.OnModelCreating modelBuilder table mapping var config modelBuilder.Configurations .GetPrivateFieldValue _modelConfiguration .GetPrivateFieldValue..
Entity Framework 4.3 - TPH mapping and migration error http://stackoverflow.com/questions/9499702/entity-framework-4-3-tph-mapping-and-migration-error protected override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Configurations.Add new ParentConfiguration The.. override void OnModelCreating DbModelBuilder modelBuilder modelBuilder.Configurations.Add new ParentConfiguration The error System.InvalidOperationException.. in 4.1. and 4.2. Something like this pattern modelBuilder.Entity Parent .Map Foo ... .Map Bar ... This doesn't work in..
|