135 references to MetadataWorkspace
System.Data.Entity (101)
System\Data\Common\Internal\Materialization\Shaper.cs (3)
31
Debug.Assert(context == null || workspace == context.
MetadataWorkspace
, "workspace must match context's workspace");
298
EntityContainer entityContainer = this.Context.
MetadataWorkspace
.GetEntityContainer(
702
EntityContainer entityContainer = this.Context.
MetadataWorkspace
.GetEntityContainer(sourceKey.EntityContainerName,
System\Data\Objects\CompiledQuery.cs (16)
383
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
395
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
407
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
419
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
431
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
443
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
455
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
467
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
479
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
491
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
503
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
515
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
527
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
539
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
551
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
563
arg0.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResult), System.Reflection.Assembly.GetCallingAssembly());
System\Data\Objects\DataClasses\EntityReference.cs (2)
199
EntitySet targetEntitySet = value.GetEntitySet(ObjectContext.
MetadataWorkspace
);
201
value.ValidateEntityKey(ObjectContext.
MetadataWorkspace
, targetEntitySet, true /*isArgumentException */, "value");
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (1)
358
EntitySet targetEntitySet = DetachedEntityKey.GetEntitySet(this.ObjectContext.
MetadataWorkspace
);
System\Data\Objects\DataClasses\RelatedEnd.cs (12)
410
TypeUsage targetOSpaceTypeUsage = ObjectContext.
MetadataWorkspace
.GetOSpaceTypeUsage(TypeUsage.Create(targetEntityType));
520
AppendKeyParameterRow(sourceBuilder, key.GetEntitySet(ObjectContext.
MetadataWorkspace
).ElementType.KeyMembers);
540
?? key.GetEntitySet(ObjectContext.
MetadataWorkspace
).ElementType.KeyMembers;
576
((ClrEnumType)ObjectContext.
MetadataWorkspace
.GetObjectSpaceType((EnumType)parameterEdmType)).ClrType;
1141
CheckRelationEntitySet(key.GetEntitySet(ObjectContext.
MetadataWorkspace
));
1900
principalKey.ValidateEntityKey(ObjectContext.
MetadataWorkspace
, principalEntitySet);
2301
EntitySet entitySet = ownerKey.GetEntitySet(context.
MetadataWorkspace
);
2397
EntitySet targetEntitySet = detachedKey.GetEntitySet(context.
MetadataWorkspace
);
2399
detachedKey.ValidateEntityKey(ObjectContext.
MetadataWorkspace
, targetEntitySet);
2421
Debug.Assert(context.
MetadataWorkspace
!= null, "The context should not have a null metadata workspace.");
2424
relationshipType = context.
MetadataWorkspace
.GetItem<EdmType>(_navigation.RelationshipName, DataSpace.CSpace);
2553
EntityType entityType = _wrappedOwner.Context.
MetadataWorkspace
.GetItem<EntityType>(_wrappedOwner.IdentityType.FullName, DataSpace.OSpace);
System\Data\Objects\DataClasses\RelationshipManager.cs (9)
376
Debug.Assert(wrappedOwner.Context.
MetadataWorkspace
!= null, "MetadataWorkspace is null");
379
EntityType entityType = wrappedOwner.Context.
MetadataWorkspace
.GetItem<EntityType>(wrappedOwner.IdentityType.FullName, DataSpace.OSpace);
654
if (wrappedOwner.Context != null && wrappedOwner.Context.
MetadataWorkspace
!= null)
656
return (ObjectItemCollection)wrappedOwner.Context.
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace);
688
if (wrappedOwner.Context != null && wrappedOwner.Context.
MetadataWorkspace
!= null)
690
collection = (DefaultObjectMappingItemCollection)wrappedOwner.Context.
MetadataWorkspace
.GetItemCollection(DataSpace.OCSpace);
826
EntityContainer entityContainer = wrappedOwner.Context.
MetadataWorkspace
.GetEntityContainer(
989
if (wrappedOwner.Context != null && wrappedOwner.Context.
MetadataWorkspace
!= null && TryGetOwnerEntityType(out entityType))
1445
EntitySet entitySet = ownerKey.GetEntitySet(wrappedOwner.Context.
MetadataWorkspace
);
System\Data\Objects\ELinq\CompiledELinqQueryState.cs (3)
83
DbQueryCommandTree tree = DbQueryCommandTree.FromValidExpression(this.ObjectContext.
MetadataWorkspace
, DataSpace.CSpace, queryExpression);
94
QueryCacheManager cacheManager = this.ObjectContext.
MetadataWorkspace
.GetQueryCacheManager();
113
DbQueryCommandTree tree = DbQueryCommandTree.FromValidExpression(this.ObjectContext.
MetadataWorkspace
, DataSpace.CSpace, queryExpression);
System\Data\Objects\ELinq\ELinqQueryState.cs (2)
179
cacheManager = this.ObjectContext.
MetadataWorkspace
.GetQueryCacheManager();
191
DbQueryCommandTree tree = DbQueryCommandTree.FromValidExpression(this.ObjectContext.
MetadataWorkspace
, DataSpace.CSpace, queryExpression);
System\Data\Objects\ELinq\ExpressionConverter.cs (2)
207
return (EdmItemCollection)_funcletizer.RootContext.
MetadataWorkspace
.GetItemCollection(DataSpace.CSpace, true);
214
return ((StoreItemCollection)_funcletizer.RootContext.
MetadataWorkspace
.GetItemCollection(DataSpace.SSpace)).StoreProviderManifest;
System\Data\Objects\Internal\EntitySqlQueryState.cs (2)
182
cacheManager = this.ObjectContext.
MetadataWorkspace
.GetQueryCacheManager();
195
DbQueryCommandTree tree = DbQueryCommandTree.FromValidExpression(this.ObjectContext.
MetadataWorkspace
, DataSpace.CSpace, queryExpression);
System\Data\Objects\Internal\ObjectQueryExecutionPlan.cs (2)
111
context.
MetadataWorkspace
, spanInfo, mergeOption, false);
192
Shaper<TResultType> shaper = shaperFactory.Create(storeReader, context, context.
MetadataWorkspace
, this.MergeOption, true);
System\Data\Objects\Internal\PocoPropertyAccessorStrategy.cs (1)
106
ObjectTypeMapping mapping = System.Data.Common.Internal.Materialization.Util.GetObjectMapping(declaringEntityType, relatedEnd.WrappedOwner.Context.
MetadataWorkspace
);
System\Data\Objects\NextResultGenerator.cs (1)
58
MetadataHelper.CheckFunctionImportReturnType<TElement>(edmType, _context.
MetadataWorkspace
);
System\Data\Objects\ObjectContext.cs (39)
538
entitySetFromKey = key.GetEntitySet(this.
MetadataWorkspace
);
627
MetadataWorkspace
.ImplicitLoadAssemblyForType(wrappedEntity.IdentityType, null);
894
MetadataWorkspace
.ImplicitLoadAssemblyForType(wrappedEntity.IdentityType, null);
939
MetadataWorkspace
.ImplicitLoadAssemblyForType(wrappedOriginalEntity.IdentityType, null);
1008
MetadataWorkspace
.ImplicitLoadAssemblyForType(wrappedEntity.IdentityType, null);
1221
MetadataWorkspace
.ImplicitLoadAssemblyForType(EntityUtil.GetEntityIdentityType(entity.GetType()), null);
1253
EntitySet entitySet = key.GetEntitySet(this.
MetadataWorkspace
);
1293
System.Collections.ObjectModel.ReadOnlyCollection<EntityContainer> entityContainers = this.
MetadataWorkspace
.GetItems<EntityContainer>(DataSpace.CSpace);
1588
if (!
MetadataWorkspace
.IsItemCollectionAlreadyRegistered(DataSpace.SSpace))
1590
Debug.Assert(!
MetadataWorkspace
.IsItemCollectionAlreadyRegistered(DataSpace.CSSpace), "ObjectContext has C-S metadata but not S?");
1609
ItemCollection contextCSpaceCollection =
MetadataWorkspace
.GetItemCollection(DataSpace.CSpace);
1614
MetadataWorkspace
.RegisterItemCollection(connectionWorkspace.GetItemCollection(DataSpace.SSpace));
1615
MetadataWorkspace
.RegisterItemCollection(connectionWorkspace.GetItemCollection(DataSpace.CSSpace));
1638
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(T), System.Reflection.Assembly.GetCallingAssembly());
1847
if (!this.
MetadataWorkspace
.TryGetEntityContainer(entityContainerName, DataSpace.CSpace, out container))
1915
this.
MetadataWorkspace
.ImplicitLoadAssemblyForType(entityCLRType, System.Reflection.Assembly.GetCallingAssembly());
1938
EntitySet entitySet = key.GetEntitySet(this.
MetadataWorkspace
);
1945
MetadataWorkspace
.ImplicitLoadFromEntityType(entitySet.ElementType, System.Reflection.Assembly.GetCallingAssembly());
2230
DbQueryCommandTree tree = DbQueryCommandTree.FromValidExpression(this.
MetadataWorkspace
, DataSpace.CSpace, refreshQuery);
2491
EntitySet entitySet = key.GetEntitySet(this.
MetadataWorkspace
);
2501
MetadataWorkspace
.ImplicitLoadFromEntityType(entitySet.ElementType, System.Reflection.Assembly.GetCallingAssembly());
2582
expectedEdmTypes[0] = MetadataHelper.GetAndCheckFunctionImportReturnType<TElement>(functionImport, 0, this.
MetadataWorkspace
);
2652
functionName, this.DefaultContainerName, this.
MetadataWorkspace
,
2716
ShaperFactory<TElement> shaperFactory = Translator.TranslateColumnMap<TElement>(cacheManager, commandDefinition.CreateColumnMap(storeReader, resultSetIndex), this.
MetadataWorkspace
, null, mergeOption, false);
2717
Shaper<TElement> shaper = shaperFactory.Create(storeReader, this, this.
MetadataWorkspace
, mergeOption, shaperOwnsReader);
2811
this.
MetadataWorkspace
.ImplicitLoadAssemblyForType(objectParameter.MappableType, null);
2890
ObjectItemCollection ospaceItems = (ObjectItemCollection)
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace);
2898
MetadataWorkspace
.ImplicitLoadAssemblyForType(type, null);
2959
MetadataWorkspace
.ImplicitLoadAssemblyForType(clrType, null);
2963
ClrEntityType entityType =
MetadataWorkspace
.GetItem<ClrEntityType>(clrType.FullName, DataSpace.OSpace);
3073
this.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TElement), System.Reflection.Assembly.GetCallingAssembly());
3121
this.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TElement), System.Reflection.Assembly.GetCallingAssembly());
3147
this.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TEntity), System.Reflection.Assembly.GetCallingAssembly());
3171
if (MetadataHelper.TryDetermineCSpaceModelType<TElement>(this.
MetadataWorkspace
, out modelEdmType) ||
3172
(unwrappedTElement.IsEnum && MetadataHelper.TryDetermineCSpaceModelType(unwrappedTElement.GetEnumUnderlyingType(), this.
MetadataWorkspace
, out modelEdmType)))
3184
columnMap = ColumnMapFactory.CreateColumnMapFromReaderAndClrType(reader, typeof(TElement), this.
MetadataWorkspace
);
3188
System.Data.Common.QueryCache.QueryCacheManager cacheManager = this.
MetadataWorkspace
.GetQueryCacheManager();
3189
ShaperFactory<TElement> shaperFactory = Translator.TranslateColumnMap<TElement>(cacheManager, columnMap, this.
MetadataWorkspace
, null, mergeOption, false);
3190
Shaper<TElement> shaper = shaperFactory.Create(reader, this, this.
MetadataWorkspace
, mergeOption, readerOwned);
System\Data\Objects\ObjectQuery_EntitySqlExtensions.cs (6)
106
context.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(T), System.Reflection.Assembly.GetCallingAssembly());
147
context.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(T), System.Reflection.Assembly.GetCallingAssembly());
191
context.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(T), System.Reflection.Assembly.GetCallingAssembly());
360
this.QueryState.ObjectContext.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResultType), System.Reflection.Assembly.GetCallingAssembly());
369
if (!this.QueryState.ObjectContext.
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace).TryGetType(clrOfType.Name, clrOfType.Namespace ?? string.Empty, out ofType) ||
475
this.QueryState.ObjectContext.
MetadataWorkspace
.ImplicitLoadAssemblyForType(typeof(TResultType), System.Reflection.Assembly.GetCallingAssembly());
System.Data.Services (12)
System\Data\Services\Providers\ObjectContextServiceProvider.cs (12)
117
EntityType sourceEntityType = this.ObjectContext.
MetadataWorkspace
.GetItem<EntityType>(resourceType.FullName, DataSpace.CSpace);
295
var metadataManager = new MetadataManager(this.ObjectContext.
MetadataWorkspace
, this.GetDefaultEntityContainer(), provider, service);
301
Double currentVersion = ((EdmItemCollection)this.ObjectContext.
MetadataWorkspace
.GetItemCollection(DataSpace.CSpace)).EdmVersion;
730
EntityType entityType = this.ObjectContext.
MetadataWorkspace
.GetItem<EntityType>(resourceType.FullName, DataSpace.CSpace);
851
MetadataWorkspace metadataWorkspace = this.ObjectContext.
MetadataWorkspace
;
966
ObjectItemCollection objectItemCollection = (ObjectItemCollection)this.ObjectContext.
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace);
970
if (this.ObjectContext.
MetadataWorkspace
.TryGetEdmSpaceType(ospaceType, out cspaceType))
1007
MetadataWorkspace workspace = ((ObjectContext)dataSourceInstance).
MetadataWorkspace
;
1716
objectContext.
MetadataWorkspace
.LoadFromAssembly(assembly);
2307
EntityContainer entityContainer = this.ObjectContext.
MetadataWorkspace
.GetEntityContainer(entityContainerName, DataSpace.CSpace);
2333
if (!this.ObjectContext.
MetadataWorkspace
.TryGetEntityContainer(
2399
EntityType cspaceEntityType = this.ObjectContext.
MetadataWorkspace
.GetItem<EntityType>(resourceType.FullName, DataSpace.CSpace);
System.Web.DynamicData (6)
DynamicData\ModelProviders\EFDataModelProvider.cs (6)
29
EntityContainer container = _context.
MetadataWorkspace
.GetEntityContainer(_context.DefaultContainerName, DataSpace.CSpace);
31
_context.
MetadataWorkspace
.LoadFromAssembly(ContextType.Assembly);
32
_objectSpaceItems = (ObjectItemCollection)_context.
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace);
40
ILookup<EntityType, EntityType> derivedTypesLookup = _context.
MetadataWorkspace
.GetItems<EntityType>(DataSpace.CSpace).ToLookup(e => (EntityType)e.BaseType);
92
var objectSpaceType = (EnumType)_context.
MetadataWorkspace
.GetObjectSpaceType(enumType);
97
var objectSpaceType = (EntityType)_context.
MetadataWorkspace
.GetObjectSpaceType(entityType);
System.Web.Entity (16)
System\Data\WebControls\EntityDataSourceView.cs (14)
301
MetadataWorkspace workspace = Context.
MetadataWorkspace
;
362
Context.
MetadataWorkspace
.GetItemCollection(DataSpace.CSpace),
762
EntityType entityType = Context.
MetadataWorkspace
.GetObjectSpaceType(CSpaceFilteredEntityType ?? EntitySet.ElementType) as EntityType;
1159
_ctx.
MetadataWorkspace
.LoadFromAssembly(assembly);
1189
_ctx.
MetadataWorkspace
.LoadFromAssembly(System.Reflection.Assembly.GetCallingAssembly());
1190
_ctx.
MetadataWorkspace
.LoadFromAssembly(contextType.Assembly);
1462
StructuralType oSpaceType = Context.
MetadataWorkspace
.GetObjectSpaceType(EntityCSpaceType);
1482
cSpaceType = (EntityType)Context.
MetadataWorkspace
.GetType(_owner.EntityTypeFilter, EntitySet.ElementType.NamespaceName, DataSpace.CSpace);
1483
if (!EntityDataSourceUtil.IsTypeOrSubtypeOf(EntitySet.ElementType, cSpaceType, Context.
MetadataWorkspace
.GetItemCollection(DataSpace.CSpace)))
1521
return Context.
MetadataWorkspace
.GetEntityContainer(ContainerName, DataSpace.CSpace);
1546
(ObjectItemCollection)(Context.
MetadataWorkspace
.GetItemCollection(DataSpace.OSpace));
1567
EntityContainer entityContainer = Context.
MetadataWorkspace
.GetEntityContainer(ContainerName, DataSpace.CSpace);
1641
EntityContainer entityContainer = Context.
MetadataWorkspace
.GetEntityContainer(ContainerName, DataSpace.CSpace);
1652
if (!Context.
MetadataWorkspace
.TryGetEntityContainer(ContainerName, DataSpace.CSpace, out container))
System\Data\WebControls\EntityDataSourceViewSchema.cs (1)
28
MetadataWorkspace workspace = wrappers.Context.
MetadataWorkspace
;
System\Data\WebControls\EntityDataSourceWrapperCollection.cs (1)
67
MetadataWorkspace ocWorkspace = context.
MetadataWorkspace
;