-
Notifications
You must be signed in to change notification settings - Fork 0
Metadata
Marcin Sulecki edited this page Mar 28, 2017
·
1 revision
private static void GetDocumentationTest()
{
using (var context = new MusicStoreContext())
{
ObjectContext objContext = ((IObjectContextAdapter)context).ObjectContext;
MetadataWorkspace workspace = objContext.MetadataWorkspace;
IEnumerable<EntityType> tables = workspace.GetItems<EntityType>(DataSpace.SSpace);
foreach (var table in tables)
{
Console.WriteLine(table.Name);
Console.WriteLine("=========");
foreach(var property in table.Properties)
{
var isPrimaryKey = table.KeyProperties.Contains(property);
if (isPrimaryKey)
Console.Write("PK ");
Console.WriteLine($"{property.Name}");
}
}
}