Skip to content

Instantly share code, notes, and snippets.

@StevenTCramer
Created January 29, 2016 20:16
Show Gist options
  • Save StevenTCramer/2d524f368595e101cc07 to your computer and use it in GitHub Desktop.
Save StevenTCramer/2d524f368595e101cc07 to your computer and use it in GitHub Desktop.
...
if (allEntitiesAttribute != null)
{
var dbContext = new MyDbContext();
return ((IObjectContextAdapter)dbContext)
.ObjectContext
.MetadataWorkspace
.GetItems<EntityType>(DataSpace.OSpace)
.Select(e => Type.GetType(e.FullName))
.Except(allEntitiesAttribute.Except)
.Select(entityType => new[] { specimenContext.Resolve(entityType) })
.ToArray();
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment