EF 6.1.0 API Review

The purpose of API Review meetings is to go over new API surface one class/member at a time to ensure we have a consistent and high quality API. We look at how classes are structured, which members are public as well as the names of classes, members and parameters.

Comparing 6.0.2 RTM to the 6.1.0 nightly build from Jan-15-2014 we decided on the following changes:

T:System.ComponentModel.DataAnnotations.Schema.CompatibilityResult

Move this type to the same namespace as the annotation/attribute infrastructure

T:System.ComponentModel.DataAnnotations.Schema.IndexAttribute

Remove the ClusteredConfiguration and UniqueConfiguration methods and introduce IsClusteredConfigured and IsUniqueConfigured to identify if the corresponding properties have been set (these will only have a getter).

IsCompatibleWith & MergeWith can be made internal and moved to be helper methods.

T:System.Data.Entity.DbConfiguration

SetAnnotationCodeGenerator should be removed from this class and just be configurable on the Migrations Code Generator. We want it to be settable on the default instance rather than having to derive from the class and override things.

T:System.Data.Entity.Core.Mapping.EndPropertyMapping

AddProperty/RemoveProperty should be renamed to AddPropertyMapping/RemovePropertyMapping – this applies to various other APIs in the System.Data.Entity.Core.Mapping namespace too.

T:System.Data.Entity.Core.Mapping.Map

Rename to MappingBase.

T:System.Data.Entity.Core.Mapping.StructuralTypeMapping

Rename Properties to MappingProperties

N:System.Data.Entity.Infrastructure

Create a System.Data.Entity.Infrastructure.Annotations namespace and move all annotation types into it (including CompatibilityResult that used to be in System.ComponentModel.DataAnnotations.Schema).

T:System.Data.Entity.Infrastructure.IMetadataAnnotationSerializer

Rename SerializeValue/DeserializeValue to Serialize/Deserialize.

T:System.Data.Entity.Infrastructure.IMergeableAnnotation

Rename ‘indexes’ parameter to ‘indexAttributes’ in the following APIs:

  • public IndexAnnotation(IEnumerable<IndexAttribute> indexes);
  • public IndexAnnotation(IndexAttribute index);
  • public virtual IEnumerable<IndexAttribute> Indexes { get; }

T:System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher

Rename ‘dbConnection’ parameters to ‘connection’

T:System.Data.Entity.Migrations.AnnotationPair

Rename to AnnotationValues.

T:System.Data.Entity.Migrations.Design.MigrationCodeGenerator

AnnotationGenerators should be public (per decision to remove DbConfiguration.SetAnnotationCodeGenerator).

RegisterAnnotationGenerators can be removed now that DbConfiguration config point is being removed.

T:System.Data.Entity.Migrations.Model.AlterTableAnnotationsOperation

Remove ‘Annotations’ and make it a more generic AlterTableOperation (to support anything we add in the future).

T:System.Data.Entity.ModelConfiguration.EntityTypeConfiguration`1

Rename HasAnnotation to HasTableAnnotation (plus other relevant places in the code base).

T:System.Data.Entity.ModelConfiguration.Configuration.BinaryPropertyConfiguration

Rename HasAnnotation to HasColumnAnnotation (plus other relevant places in the code base).

Last edited Jan 16, 2014 at 11:47 PM by RoMiller, version 4