Hi ossprologix,
>>I download the patch from codeplex.com and compiled EF. Has this been patched in EF released by Microsoft? or any other alternatives?
It seems that Entity Framework 6 provides APIs to to generate views are on the System.Data.Entity.Core.Mapping.StorageMappingItemCollection class. You can retrieve a StorageMappingCollection for a Context by using the MetadataWorkspace of an ObjectContext.
If you are using the newer DbContext API then you can access this by using the IObjectContextAdapter like below, in this code we have an instance of your derived DbContext called dbContext:
var objectContext = ((IObjectContextAdapter) dbContext).ObjectContext;
var mappingCollection = (StorageMappingItemCollection)objectContext.MetadataWorkspace
.GetItemCollection(DataSpace.CSSpace);
For more information, please refer to the following article
https://msdn.microsoft.com/en-us/data/dn469601.aspx#code
Best regards,
Cole Wu
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.