Skip to content

Conventions instead of Reflection

Latest
Compare
Choose a tag to compare
@richardlawley richardlawley released this 06 Jan 10:31
· 2 commits to master since this release

This release contains a breaking change in the way that the attributes are attached to the DbContext. Instead of this:

modelBuilder.ApplyConfigurationAttributes(typeof(TestContext).Assembly);

We now do this:

modelBuilder.Conventions.Add<DecimalPrecisionAttributeConvention>();
modelBuilder.Conventions.Add<DateTimePrecisionAttributeConvention>();

This change removes the need for reflection at startup, and allows selective enabling of conventions.