Metadata API usability: it is not possible to publically create certain type usages


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)
  • Etc.
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.


RoMiller wrote Feb 7, 2013 at 11:14 PM

EF Team Triage: This is small, we should push to get it into EF6 even though it's lower priority.

RoMiller wrote Dec 12, 2013 at 10:04 PM

EF Team Triage: Moving issues with Impact set to Low out of the 6.1.0 release as we only have time to address High and Medium issues in this release. We will re-triage these issues for future releases.

This does not exclude someone outside of the Microsoft EF team from contributing the change/fix in 6.1.0.