I started digging in the new Code First configuration/convention system and I have encountered a bit lack of flexibility.
Various elements of the EDMX schema is extensible. This allows to use additional metadata that is not defined in the built-in schema. For example:
<SchemaNamespace="TestModel.Store"Alias="Self"Provider="System.Data.SqlClient"ProviderManifestToken="2008"xmlns="http://schemas.microsoft.com/ado/2009/02/edm/ssdl"xmlns:ex="http://example.com/extensions"><EntityContainerName="TestModelStoreContainer"ex:ExtensionProperty="Metadata"></EntityContainer></Schema>
The additional metadata can be accesses by the ADO.NET providers in the MetadataProperties collection of the appropriate MetadataItem instance:
PropertyKind = Extended Name = "http://example.com/extensions:ExtensionProperty" Value = "Metadata"
This provides extensibility, that can be useful in some scenarios, for example: provider specific metadata can be added to the storage schema, that can be used during the initialization of the database.
It would be nice if the appropriate classes of the ModelConfiguration.Configuration namespace would allow to manage these extension properties. It would enable writing custom conventions that can add provider specific metadata to filtered elements.
Furthermore, the current DbCompiledModel class does not support extension properties, because the edmx serializer components do not serialize them.
Maybe fixing these issues could be easily done by utilizing the DataModelAnnotation class. Do you plan adding this kind of extensibility?
Regards,
Tamas