As part of the work on public code first conventions we are enabling user code to manipulate EF models at runtime. Unfortunately there are several fundamental pieces missing in the object model that represents the different layers of an EF model. In the
design meeting of 1/17/2013
we decided we would consider making changes as part of pre-release API scrub/polish, adding new surface and obsoleting old surface where the value in doing so is significant.
Here is a particular issue that we might want to address: Public TypeUsage builder methods exist such as
- CreateDefaultTypeUsage(EdmType edmType),
- CreateStringTypeUsage(PrimitiveType primitiveType, bool isUnicode, bool isFixedLength, int maxLength)
- CreateTimeTypeUsage(PrimitiveType primitiveType, byte? precision)
There are basic combinations, like nullable int, that are missing and the basic building block, which would be more convenient to create TypeUsages programatically, Create(EdmType edmType, IEnumerable<Facet> facets), is internal.
As a consequence it is not possible to create some of the supported type usages using public API.
We should consider filling any holes in the builder methods and making any useful building blocks public, e.g. making Create(EdmType, IEnumerable<Facet>) public as well as making Facet publically constructible somehow.