O'Reilly logo

Fluent Entity Framework by Rebecca M. Riordan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Fluent methods

Once you get past the generic and lambda syntax for entities and properties, the methods exposed by the configuration objects are pretty self-explanatory. Here’s a list of a few of the most common ones. Notice that in addition to the general Property methods shown, each data type has some methods specific to it. A few of those are included in the list, as well. If you want the complete list, check MSDN for the classes defined in the System.Data.Entity.ModelConfiguration.Configuration namespace. (Or just use Intellisense. It’s a whole lot easier.)

Modelbuilder methods

ModelBuilder.Ignore<TEntity>Modelbuild.Entity<T>

 

Entity methods

HasEntitySetName()HasKey<TProperty>()ToTable()

 

General property methods

HasColumnName()HasColumnOrder() ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required