I have following code
using (WdmEntities context = new WdmEntities())
{
//get object models from context
ObjectContext objContext = ((IObjectContextAdapter)context).ObjectContext;
var container = objContext.MetadataWorkspace.GetEntityContainer(objContext.DefaultContainerName, DataSpace.CSpace);
List<string> schemas = new List<string>();
foreach (var set in container.BaseEntitySets)
{
foreach (var metaproperty in set.MetadataProperties)
{
//here
if(metaproperty.Name == "Schema")
{
//but metaproperty.Value == NULL
schemas.Add(metaproperty.Value);
}
}
}
}
I get null values instead of schemas names. How i can get names of shemas from entity framework. (In my db i have two different shemas.) Maybe someone knows another way?
I had the wrong approach. The code bellow shows how i was able to get the name of the schemes.