2 implementations of IEntityWrapper
System.Data.Entity (2)
System\Data\Objects\Internal\BaseEntityWrapper.cs (1)
23
internal abstract class BaseEntityWrapper<TEntity> :
IEntityWrapper
System\Data\Objects\Internal\NullEntityWrapper.cs (1)
21
internal class NullEntityWrapper :
IEntityWrapper
395 references to IEntityWrapper
System.Data.Entity (395)
System\Data\Common\EntityUtil.cs (1)
1492
internal static void CheckEntityKeysMatch(
IEntityWrapper
wrappedEntity, EntityKey key)
System\Data\Common\Internal\Materialization\Coordinator.cs (5)
193
private List<
IEntityWrapper
> _wrappedElements;
200
private Action<Shaper, List<
IEntityWrapper
>> _handleClose;
249
_wrappedElements = new List<
IEntityWrapper
>();
265
IEntityWrapper
wrappedElement = null;
314
internal void RegisterCloseHandler(Action<Shaper, List<
IEntityWrapper
>> closeHandler)
System\Data\Common\Internal\Materialization\CoordinatorFactory.cs (3)
172
internal readonly Func<Shaper,
IEntityWrapper
> WrappedElement;
209
if (typeof(
IEntityWrapper
).IsAssignableFrom(element.Type))
211
this.WrappedElement = Translator.Compile<
IEntityWrapper
>(element);
System\Data\Common\Internal\Materialization\Shaper.cs (28)
50
private IList<
IEntityWrapper
> _materializedEntities;
124
public
IEntityWrapper
HandleEntityNoTracking<TEntity>(
IEntityWrapper
wrappedEntity)
137
public
IEntityWrapper
HandleEntity<TEntity>(
IEntityWrapper
wrappedEntity, EntityKey entityKey, EntitySet entitySet)
144
IEntityWrapper
result = wrappedEntity;
181
public
IEntityWrapper
HandleEntityAppendOnly<TEntity>(Func<Shaper,
IEntityWrapper
> constructEntityDelegate, EntityKey entityKey, EntitySet entitySet)
186
IEntityWrapper
result;
239
public
IEntityWrapper
HandleFullSpanCollection<T_SourceEntity, T_TargetEntity>(
IEntityWrapper
wrappedEntity, Coordinator<T_TargetEntity> coordinator, AssociationEndMember targetMember)
253
public
IEntityWrapper
HandleFullSpanElement<T_SourceEntity, T_TargetEntity>(
IEntityWrapper
wrappedSource,
IEntityWrapper
wrappedSpannedEntity, AssociationEndMember targetMember)
260
List<
IEntityWrapper
> spannedEntities = null;
265
spannedEntities = new List<
IEntityWrapper
>(1);
281
public
IEntityWrapper
HandleRelationshipSpan<T_SourceEntity>(
IEntityWrapper
wrappedEntity, EntityKey targetKey, AssociationEndMember targetMember)
409
private bool TryGetRelatedEnd(
IEntityWrapper
wrappedEntity, AssociationType associationType, string sourceEndName, string targetEndName, out RelatedEnd relatedEnd)
528
public
IEntityWrapper
HandleIEntityWithKey<TEntity>(
IEntityWrapper
wrappedEntity, EntitySet entitySet)
665
private void CheckClearedEntryOnSpan(object targetValue,
IEntityWrapper
wrappedSource, EntityKey sourceKey, AssociationEndMember targetMember)
692
private void CheckClearedEntryOnSpan(EntityKey sourceKey,
IEntityWrapper
wrappedSource, AssociationEndMember targetMember)
719
private void FullSpanAction<T_TargetEntity>(
IEntityWrapper
wrappedSource, IList<T_TargetEntity> spannedEntities, AssociationEndMember targetMember)
741
private void UpdateEntry<TEntity>(
IEntityWrapper
wrappedEntity, EntityEntry existingEntry)
975
foreach (
var
wrappedEntity in _materializedEntities)
989
_materializedEntities = new List<
IEntityWrapper
>();
998
protected void RegisterMaterializedEntityForEvent(
IEntityWrapper
wrappedEntity)
System\Data\Common\Internal\Materialization\Translator.cs (4)
92
if (!typeof(
IEntityWrapper
).IsAssignableFrom(ReturnedExpression.Type))
592
private static readonly PropertyInfo IEntityWrapper_Entity = typeof(
IEntityWrapper
).GetProperty("Entity");
713
if (input.Type != type && !typeof(
IEntityWrapper
).IsAssignableFrom(input.Type))
800
result = Expression.Convert(result, typeof(
IEntityWrapper
));
System\Data\Objects\DataClasses\EntityCollection.cs (39)
48
private Dictionary<TEntity,
IEntityWrapper
> _wrappedRelatedEntities;
62
internal EntityCollection(
IEntityWrapper
wrappedOwner, RelationshipNavigation navigation, IRelationshipFixer relationshipFixer)
97
private Dictionary<TEntity,
IEntityWrapper
> WrappedRelatedEntities
103
_wrappedRelatedEntities = new Dictionary<TEntity,
IEntityWrapper
>();
165
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
228
Load((List<
IEntityWrapper
>)null, mergeOption);
252
IList<
IEntityWrapper
> wrappedEntities = new List<
IEntityWrapper
>();
275
Attach(new
IEntityWrapper
[] { EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext) }, false);
285
internal void Load(List<
IEntityWrapper
> collection, MergeOption mergeOption)
328
internal override void DisconnectedAdd(
IEntityWrapper
wrappedEntity)
349
internal override bool DisconnectedRemove(
IEntityWrapper
wrappedEntity)
389
List<
IEntityWrapper
> wrappedRelatedEntities = new List<
IEntityWrapper
>(_wrappedRelatedEntities.Values);
390
foreach (
IEntityWrapper
wrappedEntity in wrappedRelatedEntities)
394
IEntityWrapper
identityWrapper = EntityWrapperFactory.WrapEntityUsingContext(wrappedEntity.Entity, WrappedOwner.Context);
410
foreach (
IEntityWrapper
wrappedEntity in _wrappedRelatedEntities.Values)
419
List<
IEntityWrapper
> values = new List<
IEntityWrapper
>(_wrappedRelatedEntities.Values);
420
foreach (
IEntityWrapper
wrappedEntity in values)
454
internal override void ClearCollectionOrRef(
IEntityWrapper
wrappedEntity, RelationshipNavigation navigation, bool doCascadeDelete)
460
List<
IEntityWrapper
> tempCopy = new List<
IEntityWrapper
>(_wrappedRelatedEntities.Values);
461
foreach (
IEntityWrapper
wrappedCurrent in tempCopy)
496
internal override bool VerifyEntityForAdd(
IEntityWrapper
wrappedEntity, bool relationshipAlreadyExists)
509
internal override bool CanSetEntityType(
IEntityWrapper
wrappedEntity)
514
internal override void VerifyType(
IEntityWrapper
wrappedEntity)
528
internal override bool RemoveFromLocalCache(
IEntityWrapper
wrappedEntity, bool resetIsLoaded, bool preserveForeignKey)
548
internal override bool RemoveFromObjectCache(
IEntityWrapper
wrappedEntity)
587
internal override bool ContainsEntity(
IEntityWrapper
wrappedEntity)
620
internal override IEnumerable<
IEntityWrapper
> GetWrappedEntities()
638
List<
IEntityWrapper
> affectedEntities = new List<
IEntityWrapper
>(_wrappedRelatedEntities.Values);
644
foreach (
IEntityWrapper
wrappedEntity in affectedEntities)
727
internal override bool CheckIfNavigationPropertyContainsEntity(
IEntityWrapper
wrapper)
759
internal override void VerifyNavigationPropertyForAdd(
IEntityWrapper
wrapper)
796
_wrappedRelatedEntities = new Dictionary<TEntity,
IEntityWrapper
>();
821
internal override void AddToLocalCache(
IEntityWrapper
wrappedEntity, bool applyConstraints)
827
internal override void AddToObjectCache(
IEntityWrapper
wrappedEntity)
System\Data\Objects\DataClasses\EntityReference.cs (8)
59
internal EntityReference(
IEntityWrapper
wrappedOwner, RelationshipNavigation navigation, IRelationshipFixer relationshipFixer)
384
internal abstract
IEntityWrapper
CachedValue
389
internal abstract
IEntityWrapper
ReferenceValue
396
internal EntityKey ValidateOwnerWithRIConstraints(
IEntityWrapper
targetEntity, EntityKey targetEntityKey, bool checkBothEnds)
423
internal void ValidateSettingRIConstraints(
IEntityWrapper
targetEntity, bool settingToNull, bool changingForeignKeyValue)
461
internal void UpdateForeignKeyValues(
IEntityWrapper
dependentEntity,
IEntityWrapper
principalEntity, Dictionary<int, object> changedFKs, bool forceChange)
565
internal void UpdateForeignKeyValues(
IEntityWrapper
dependentEntity, EntityKey principalKey)
System\Data\Objects\DataClasses\EntityReference_TResultType.cs (23)
43
private
IEntityWrapper
_wrappedCachedValue;
59
internal EntityReference(
IEntityWrapper
wrappedOwner, RelationshipNavigation navigation, IRelationshipFixer relationshipFixer)
87
internal override
IEntityWrapper
CachedValue
92
internal override
IEntityWrapper
ReferenceValue
233
internal override IEnumerable<
IEntityWrapper
> GetWrappedEntities()
236
return _wrappedCachedValue.Entity == null ? new
IEntityWrapper
[0] : new
IEntityWrapper
[] { _wrappedCachedValue };
254
Attach(new
IEntityWrapper
[] { EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext) }, false);
266
IEntityWrapper
identityWrapper = EntityWrapperFactory.WrapEntityUsingContext(_wrappedCachedValue.Entity, WrappedOwner.Context);
319
IEntityWrapper
wrappedTarget = existingEntry.WrappedEntity;
452
internal override void ClearCollectionOrRef(
IEntityWrapper
wrappedEntity, RelationshipNavigation navigation, bool doCascadeDelete)
505
internal override bool VerifyEntityForAdd(
IEntityWrapper
wrappedEntity, bool relationshipAlreadyExists)
517
internal override bool CanSetEntityType(
IEntityWrapper
wrappedEntity)
522
internal override void VerifyType(
IEntityWrapper
wrappedEntity)
534
internal override void DisconnectedAdd(
IEntityWrapper
wrappedEntity)
543
internal override bool DisconnectedRemove(
IEntityWrapper
wrappedEntity)
555
internal override bool RemoveFromLocalCache(
IEntityWrapper
wrappedEntity, bool resetIsLoaded, bool preserveForeignKey)
581
internal override bool RemoveFromObjectCache(
IEntityWrapper
wrappedEntity)
665
internal override bool ContainsEntity(
IEntityWrapper
wrappedEntity)
703
internal override bool CheckIfNavigationPropertyContainsEntity(
IEntityWrapper
wrapper)
718
internal override void VerifyNavigationPropertyForAdd(
IEntityWrapper
wrapper)
762
internal override void AddToLocalCache(
IEntityWrapper
wrappedEntity, bool applyConstraints)
799
internal override void AddToObjectCache(
IEntityWrapper
wrappedEntity)
System\Data\Objects\DataClasses\RelatedEnd.cs (76)
45
internal RelatedEnd(
IEntityWrapper
wrappedOwner, RelationshipNavigation navigation, IRelationshipFixer relationshipFixer)
103
private
IEntityWrapper
_wrappedOwner;
215
internal
IEntityWrapper
WrappedOwner
773
List<
IEntityWrapper
> refreshedCollection = collection as List<
IEntityWrapper
>;
776
refreshedCollection = new List<
IEntityWrapper
>();
780
IEntityWrapper
wrapper = EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext);
794
internal void Merge<TEntity>(List<
IEntityWrapper
> collection, MergeOption mergeOption, bool setIsLoaded)
837
Attach(new
IEntityWrapper
[] { EntityWrapperFactory.WrapEntityUsingContext(entity, ObjectContext) }, false);
840
internal void Attach(IEnumerable<
IEntityWrapper
> wrappedEntities, bool allowCollection)
847
List<
IEntityWrapper
> collection = new List<
IEntityWrapper
>();
849
foreach (
IEntityWrapper
entity in wrappedEntities)
877
foreach (
IEntityWrapper
wrappedTarget in collection)
918
internal void ValidateEntityForAttach(
IEntityWrapper
wrappedEntity, int index, bool allowCollection)
1000
internal void Add(
IEntityWrapper
wrappedEntity)
1047
internal bool Remove(
IEntityWrapper
wrappedEntity, bool preserveForeignKey)
1072
internal abstract void DisconnectedAdd(
IEntityWrapper
wrappedEntity);
1073
internal abstract bool DisconnectedRemove(
IEntityWrapper
wrappedEntity);
1075
internal void Add(
IEntityWrapper
wrappedEntity, bool applyConstraints)
1113
internal void ValidateStateForAdd(
IEntityWrapper
wrappedEntity)
1123
internal void Add(
IEntityWrapper
wrappedTarget,
1224
IEntityWrapper
entityToAdd = null; // the entity to be added to attachedRelatedEnd
1357
private void AddGraphToObjectStateManager(
IEntityWrapper
wrappedEntity, bool relationshipAlreadyExists,
1385
private void UpdateSnapshotOfRelationships(
IEntityWrapper
wrappedEntity)
1396
internal void Remove(
IEntityWrapper
wrappedEntity, bool doFixup, bool deleteEntity, bool deleteOwner, bool applyReferentialConstraints, bool preserveForeignKey)
1567
internal void IncludeEntity(
IEntityWrapper
wrappedEntity, bool addRelationshipAsUnchanged, bool doAttach)
1712
internal abstract bool CheckIfNavigationPropertyContainsEntity(
IEntityWrapper
wrapper);
1714
internal abstract void VerifyNavigationPropertyForAdd(
IEntityWrapper
wrapper);
1716
internal void AddToNavigationProperty(
IEntityWrapper
wrapper)
1734
internal void RemoveFromNavigationProperty(
IEntityWrapper
wrapper)
1746
internal void ExcludeEntity(
IEntityWrapper
wrappedEntity)
1779
internal RelationshipEntry FindRelationshipEntryInObjectStateManager(
IEntityWrapper
wrappedEntity)
1790
internal void Clear(
IEntityWrapper
wrappedEntity, RelationshipNavigation navigation, bool doCascadeDelete)
1830
IEntityWrapper
wrappedRelatedEntity = ((EntityReference)this).ReferenceValue;
1866
foreach (
IEntityWrapper
wrappedRelatedEntity in GetWrappedEntities())
1888
private EntityKey ExtractPrincipalKey(
IEntityWrapper
wrappedRelatedEntity)
1951
List<
IEntityWrapper
> deletedEntities = null;
1957
foreach (
IEntityWrapper
wrappedEntity in GetWrappedEntities())
1961
deletedEntities = new List<
IEntityWrapper
>();
1969
foreach (
IEntityWrapper
wrappedEntity in deletedEntities)
1989
List<
IEntityWrapper
> deletedEntities = new List<
IEntityWrapper
>();
1991
foreach (
IEntityWrapper
wrappedEntity in GetWrappedEntities())
2004
foreach (
IEntityWrapper
wrappedEntity in deletedEntities)
2039
foreach (
IEntityWrapper
wrappedEntity in deletedEntities)
2051
internal void AddToCache(
IEntityWrapper
wrappedEntity, bool applyConstraints)
2056
internal abstract void AddToLocalCache(
IEntityWrapper
wrappedEntity, bool applyConstraints);
2057
internal abstract void AddToObjectCache(
IEntityWrapper
wrappedEntity);
2063
internal bool RemoveFromCache(
IEntityWrapper
wrappedEntity, bool resetIsLoaded, bool preserveForeignKey)
2070
internal abstract bool RemoveFromLocalCache(
IEntityWrapper
wrappedEntity, bool resetIsLoaded, bool preserveForeignKey);
2072
internal abstract bool RemoveFromObjectCache(
IEntityWrapper
wrappedEntity);
2076
internal abstract bool VerifyEntityForAdd(
IEntityWrapper
wrappedEntity, bool relationshipAlreadyExists);
2077
internal abstract void VerifyType(
IEntityWrapper
wrappedEntity);
2078
internal abstract bool CanSetEntityType(
IEntityWrapper
wrappedEntity);
2081
internal abstract void ClearCollectionOrRef(
IEntityWrapper
wrappedEntity, RelationshipNavigation navigation, bool doCascadeDelete);
2082
internal abstract bool ContainsEntity(
IEntityWrapper
wrappedEntity);
2084
internal abstract IEnumerable<
IEntityWrapper
> GetWrappedEntities();
2093
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2103
private void AddEntityToObjectStateManager(
IEntityWrapper
wrappedEntity, bool doAttach)
2146
private RelationshipEntry AddRelationshipToObjectStateManager(
IEntityWrapper
wrappedEntity, bool addRelationshipAsUnchanged, bool doAttach)
2168
private static void WalkObjectGraphToIncludeAllRelatedEntities(
IEntityWrapper
wrappedEntity,
2178
internal static void RemoveEntityFromObjectStateManager(
IEntityWrapper
wrappedEntity)
2201
private static void RemoveRelationshipFromObjectStateManager(
IEntityWrapper
wrappedEntity,
IEntityWrapper
wrappedOwner, RelationshipSet relationshipSet, RelationshipNavigation navigation)
2213
private void FixupOtherEndOfRelationshipForRemove(
IEntityWrapper
wrappedEntity, bool preserveForeignKey)
2221
private static EntityEntry MarkEntityAsDeletedInObjectStateManager(
IEntityWrapper
wrappedEntity)
2237
private static RelationshipEntry MarkRelationshipAsDeletedInObjectStateManager(
IEntityWrapper
wrappedEntity,
IEntityWrapper
wrappedOwner, RelationshipSet relationshipSet, RelationshipNavigation navigation)
2254
private static void DetachRelationshipFromObjectStateManager(
IEntityWrapper
wrappedEntity,
IEntityWrapper
wrappedOwner, RelationshipSet relationshipSet, RelationshipNavigation navigation)
2271
private static void RemoveEntityFromRelatedEnds(
IEntityWrapper
wrappedEntity1,
IEntityWrapper
wrappedEntity2, RelationshipNavigation navigation)
2481
internal RelatedEnd GetOtherEndOfRelationship(
IEntityWrapper
wrappedEntity)
2506
internal void InitializeRelatedEnd(
IEntityWrapper
wrappedOwner, RelationshipNavigation navigation, IRelationshipFixer relationshipFixer)
2513
internal void SetWrappedOwner(
IEntityWrapper
wrappedOwner)
System\Data\Objects\DataClasses\RelationshipManager.cs (29)
59
private
IEntityWrapper
_wrappedOwner;
109
internal
IEntityWrapper
WrappedOwner
167
internal void SetWrappedOwner(
IEntityWrapper
wrappedOwner, object expectedOwner)
288
List<
IEntityWrapper
> tempEntities = new List<
IEntityWrapper
>(collection.CountInternal);
289
foreach (
IEntityWrapper
wrappedEntity in collection.GetWrappedEntities())
298
foreach (
IEntityWrapper
wrappedEntity in tempEntities)
373
IEntityWrapper
wrappedOwner = WrappedOwner;
412
IEntityWrapper
wrappedOwner = WrappedOwner;
495
IEntityWrapper
wrappedOwner = WrappedOwner;
534
IEntityWrapper
wrappedOwner = WrappedOwner;
588
IEntityWrapper
wrappedOwner = WrappedOwner;
652
private static ObjectItemCollection GetObjectItemCollection(
IEntityWrapper
wrappedOwner)
686
private static bool TryGetObjectMappingItemCollection(
IEntityWrapper
wrappedOwner, out DefaultObjectMappingItemCollection collection)
700
internal static bool TryGetRelationshipType(
IEntityWrapper
wrappedOwner, Type entityClrType, string relationshipName, out AssociationType associationType)
725
internal static Exception UnableToGetMetadata(
IEntityWrapper
wrappedOwner, string relationshipName)
803
IEntityWrapper
wrappedOwner = WrappedOwner;
936
IEntityWrapper
wrappedOwner = WrappedOwner;
986
IEntityWrapper
wrappedOwner = WrappedOwner;
1024
IEntityWrapper
wrappedOwner = WrappedOwner;
1077
IEntityWrapper
wrappedOwner = WrappedOwner;
1115
internal static void RemoveRelatedEntitiesFromObjectStateManager(
IEntityWrapper
wrappedEntity)
1160
foreach (
IEntityWrapper
dependent in relatedEnd.GetWrappedEntities())
1193
internal void RemoveEntity(string toRole, string relationshipName,
IEntityWrapper
wrappedEntity)
1221
IEntityWrapper
wrappedOwner = WrappedOwner;
1436
IEntityWrapper
wrappedOwner = WrappedOwner;
1490
internal bool IsOwner(
IEntityWrapper
wrappedEntity)
1492
IEntityWrapper
wrappedOwner = WrappedOwner;
1546
foreach (
IEntityWrapper
wrappedEntity in relatedEnd.GetWrappedEntities())
System\Data\Objects\ELinq\InitializerFacet.cs (1)
491
public static EntityCollection<T> CreateEntityCollection<T>(Shaper state,
IEntityWrapper
wrappedOwner, Coordinator<T> coordinator, string relationshipName, string targetRoleName)
System\Data\Objects\EntityEntry.cs (23)
26
private
IEntityWrapper
_wrappedEntity; // Contains null entity if IsKeyEntry
59
internal EntityEntry(
IEntityWrapper
wrappedEntity, EntityKey entityKey, EntitySet entitySet, ObjectStateManager cache,
579
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingStateManager(currentEntity, this.ObjectStateManager);
599
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingStateManager(originalEntity, this.ObjectStateManager);
1041
internal
IEntityWrapper
WrappedEntity
2173
IEntityWrapper
relatedWrapper;
2313
Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>>> relationships,
2318
IEntityWrapper
relatedWrapper = EntityWrapperFactory.WrapEntityUsingStateManager(relatedObject, this.ObjectStateManager);
2337
Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>> relationships,
2338
Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>> principalRelationships,
2348
IEntityWrapper
relatedWrapper = relatedEntry.WrappedEntity; ;
2367
Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<T>>> relationships,
2444
IEntityWrapper
existingWrappedEntity = _wrappedEntity;
2830
internal void PromoteKeyEntry(
IEntityWrapper
wrappedEntity, IExtendedDataRecord shadowValues, StateManagerTypeMetadata typeMetadata)
3276
Debug.Assert(!(value is
IEntityWrapper
));
3341
internal void ApplyCurrentValuesInternal(
IEntityWrapper
wrappedCurrentEntity)
3364
Debug.Assert(!(value is
IEntityWrapper
));
3368
internal void ApplyOriginalValuesInternal(
IEntityWrapper
wrappedOriginalEntity)
3453
IEntityWrapper
existingPrincipal = reference.ReferenceValue;
3611
private bool WillNotRefSteal(EntityReference refToPrincipal,
IEntityWrapper
wrappedPrincipal)
3704
IEntityWrapper
existingPrincipal = reference.ReferenceValue;
3756
foreach (
IEntityWrapper
dependent in principalEnd.GetWrappedEntities())
System\Data\Objects\Internal\BaseEntityWrapper.cs (2)
47
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
71
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
System\Data\Objects\Internal\EntityProxyFactory.cs (8)
128
internal static bool TryGetProxyWrapper(object instance, out
IEntityWrapper
wrapper)
193
internal static bool TryGetAssociationTypeFromProxyInfo(
IEntityWrapper
wrappedEntity, string relationshipName, string targetRoleName, out AssociationType associationType)
527
Debug.Assert(wrappedEntityAsObject == null || wrappedEntityAsObject is
IEntityWrapper
, "wrappedEntityAsObject must be an IEntityWrapper");
528
var
wrappedEntity = (
IEntityWrapper
)wrappedEntityAsObject; // We want an exception if the cast fails.
1060
static readonly MethodInfo s_IEntityWrapper_GetEntity = typeof(
IEntityWrapper
).GetProperty("Entity").GetGetMethod();
1160
DynamicMethod initializeEntityCollections = LightweightCodeGenerator.CreateDynamicMethod(proxyType.Name + "_InitializeEntityCollections", typeof(
IEntityWrapper
), new Type[] { typeof(
IEntityWrapper
) });
System\Data\Objects\Internal\EntityProxyTypeInfo.cs (7)
94
IEntityWrapper
wrapper = ((
IEntityWrapper
)getEntityWrapperDelegate(proxy));
196
internal
IEntityWrapper
SetEntityWrapper(
IEntityWrapper
wrapper)
200
return Proxy_SetEntityWrapper(wrapper.Entity, wrapper) as
IEntityWrapper
;
208
internal
IEntityWrapper
GetEntityWrapper(object entity)
210
return Proxy_GetEntityWrapper(entity) as
IEntityWrapper
;
System\Data\Objects\Internal\EntityWrapperFactory.cs (19)
29
private static readonly Memoizer<Type, Func<object,
IEntityWrapper
>> _delegateCache = new Memoizer<Type, Func<object,
IEntityWrapper
>>(CreateWrapperDelegate, null);
34
internal static
IEntityWrapper
NullWrapper
49
internal static
IEntityWrapper
CreateNewWrapper(object entity, EntityKey key)
51
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
58
IEntityWrapper
wrappedEntity = _delegateCache.Evaluate(entity.GetType())(entity);
80
private static Func<object,
IEntityWrapper
> CreateWrapperDelegate(Type entityType)
105
return (Func<object,
IEntityWrapper
>)createDelegate.Invoke(null, new object[0]);
109
private static Func<object,
IEntityWrapper
> CreateWrapperDelegateTypedLightweight<TEntity>()
116
private static Func<object,
IEntityWrapper
> CreateWrapperDelegateTypedWithRelationships<TEntity>()
128
private static Func<object,
IEntityWrapper
> CreateWrapperDelegateTypedWithoutRelationships<TEntity>()
184
internal static
IEntityWrapper
WrapEntityUsingContext(object entity, ObjectContext context)
198
internal static
IEntityWrapper
WrapEntityUsingContextGettingEntry(object entity, ObjectContext context, out EntityEntry existingEntry)
211
internal static
IEntityWrapper
WrapEntityUsingStateManager(object entity, ObjectStateManager stateManager)
226
internal static
IEntityWrapper
WrapEntityUsingStateManagerGettingEntry(object entity, ObjectStateManager stateManager, out EntityEntry existingEntry)
228
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
229
IEntityWrapper
wrapper = null;
262
IEntityWrapper
wrappedEntity = relManager.WrappedOwner;
297
internal static void UpdateNoTrackingWrapper(
IEntityWrapper
wrapper, ObjectContext context, EntitySet entitySet)
System\Data\Objects\Internal\LazyLoadBehavior.cs (3)
166
Debug.Assert(wrapperObject == null || wrapperObject is
IEntityWrapper
, "wrapperObject must be an IEntityWrapper");
167
IEntityWrapper
wrapper = (
IEntityWrapper
)wrapperObject; // We want an exception if the cast fails.
System\Data\Objects\Internal\NullEntityWrapper.cs (2)
23
private static
IEntityWrapper
s_nullWrapper = new NullEntityWrapper();
33
internal static
IEntityWrapper
NullWrapper
System\Data\Objects\Internal\TransactionManager.cs (27)
26
internal Dictionary<RelatedEnd, IList<
IEntityWrapper
>> PromotedRelationships
69
internal HashSet<
IEntityWrapper
> ProcessedEntities
76
internal Dictionary<object,
IEntityWrapper
> WrappedEntities
102
internal Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>>> AddedRelationshipsByGraph
109
internal Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>>> DeletedRelationshipsByGraph
116
internal Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>> AddedRelationshipsByForeignKey
123
internal Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>> AddedRelationshipsByPrincipalKey
130
internal Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>> DeletedRelationshipsByForeignKey
137
internal Dictionary<
IEntityWrapper
, HashSet<RelatedEnd>> ChangedForeignKeys
226
this.PromotedRelationships = new Dictionary<RelatedEnd, IList<
IEntityWrapper
>>();
232
this.ProcessedEntities = new HashSet<
IEntityWrapper
>();
233
this.WrappedEntities = new Dictionary<object,
IEntityWrapper
>();
261
this.PromotedRelationships = new Dictionary<RelatedEnd, IList<
IEntityWrapper
>>();
267
this.ProcessedEntities = new HashSet<
IEntityWrapper
>();
268
this.WrappedEntities = new Dictionary<object,
IEntityWrapper
>();
302
this.ProcessedEntities = new HashSet<
IEntityWrapper
>();
303
this.WrappedEntities = new Dictionary<object,
IEntityWrapper
>();
305
this.DeletedRelationshipsByGraph = new Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>>>();
306
this.AddedRelationshipsByGraph = new Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>>>();
307
this.DeletedRelationshipsByForeignKey = new Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>>();
308
this.AddedRelationshipsByForeignKey = new Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>>();
309
this.AddedRelationshipsByPrincipalKey = new Dictionary<
IEntityWrapper
, Dictionary<RelatedEnd, HashSet<EntityKey>>>();
310
this.ChangedForeignKeys = new Dictionary<
IEntityWrapper
, HashSet<RelatedEnd>>();
System\Data\Objects\ObjectContext.cs (25)
512
private void VerifyRootForAdd(bool doAttach, string entitySetName,
IEntityWrapper
wrappedEntity, EntityEntry existingEntry, out EntitySet entitySet, out bool isNoOperation)
611
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
616
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContextGettingEntry(entity, this, out existingEntry);
697
internal void AddSingleObject(EntitySet entitySet,
IEntityWrapper
wrappedEntity, string argumentName)
750
IEntityWrapper
wrappedEntity = WrapEntityAndCheckContext(entity, "property");
766
IEntityWrapper
wrappedEntity = WrapEntityAndCheckContext(entity, "property");
790
IEntityWrapper
wrappedEntity = WrapEntityAndCheckContext(entity, "property");
815
IEntityWrapper
wrappedEntity = WrapEntityAndCheckContext(entity, "property");
820
private
IEntityWrapper
WrapEntityAndCheckContext(object entity, string refType)
822
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContext(entity, this);
888
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContext(currentEntity, this);
933
IEntityWrapper
wrappedOriginalEntity = EntityWrapperFactory.WrapEntityUsingContext(originalEntity, this);
992
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
997
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContextGettingEntry(entity, this, out existingEntry);
1093
internal void AttachSingleObject(
IEntityWrapper
wrappedEntity, EntitySet entitySet, string argumentName)
1194
private void VerifyContextForAddOrAttach(
IEntityWrapper
wrappedEntity)
1213
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
1241
Debug.Assert(!(entityLike is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
1247
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContext(entityLike, this);
1711
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
1759
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
1991
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2019
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2254
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingContext(entity, this);
2975
IEntityWrapper
wrappedEntity = EntityWrapperFactory.CreateNewWrapper(instance, null);
System\Data\Objects\ObjectStateManager.cs (60)
253
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
262
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
307
private void ValidateProxyType(
IEntityWrapper
wrappedEntity)
329
internal EntityEntry AddEntry(
IEntityWrapper
wrappedObject, EntityKey passedKey, EntitySet entitySet, string argumentName, bool isAdded)
639
IEntityWrapper
wrappedEntity,
687
IEntityWrapper
wrappedEntity,
756
internal void TrackPromotedRelationship(RelatedEnd relatedEnd,
IEntityWrapper
wrappedEntity)
763
IList<
IEntityWrapper
> entities;
766
entities = new List<
IEntityWrapper
>();
778
foreach (
IEntityWrapper
wrappedEntity in pair.Value)
803
IEntityWrapper
wrappedSource,
805
IEntityWrapper
wrappedTarget,
845
var
currentWrappedTarget = relatedReference.ReferenceValue;
925
private static void UpdateRelatedEnd(RelatedEnd relatedEnd,
IEntityWrapper
wrappedEntity,
IEntityWrapper
wrappedRelatedEntity, bool setIsLoaded, MergeOption mergeOption)
968
internal static int UpdateRelationships(ObjectContext context, MergeOption mergeOption, AssociationSet associationSet, AssociationEndMember sourceMember, EntityKey sourceKey,
IEntityWrapper
wrappedSource, AssociationEndMember targetMember, IList targets, bool setIsLoaded)
990
IEntityWrapper
wrappedTarget = someTarget as
IEntityWrapper
;
1085
private static void EnsureCollectionNotNull(AssociationEndMember sourceMember,
IEntityWrapper
wrappedSource, AssociationEndMember targetMember)
1163
internal static bool TryUpdateExistingRelationships(ObjectContext context, MergeOption mergeOption, AssociationSet associationSet, AssociationEndMember sourceMember, EntityKey sourceKey,
IEntityWrapper
wrappedSource, AssociationEndMember targetMember, EntityKey targetKey, bool setIsLoaded, out EntityState newEntryState)
1408
internal EntityEntry AttachEntry(EntityKey entityKey,
IEntityWrapper
wrappedObject, EntitySet entitySet, string argumentName)
1454
private void CheckKeyMatchesEntity(
IEntityWrapper
wrappedEntity, EntityKey entityKey, EntitySet entitySetForType, bool forAttach)
1744
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2455
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2467
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2485
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2590
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
2669
IEntityWrapper
wrappedEntity = EntityWrapperFactory.WrapEntityUsingStateManager(entity, this);
2722
IEntityWrapper
wrappedEntity = entry.WrappedEntity; // we have to cache the entity before detaching it totally so we can fire event
2960
internal void RemoveEntryFromKeylessStore(
IEntityWrapper
wrappedEntity)
3122
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> addedRelationshipsByGraph;
3201
IEntityWrapper
addedEntity = pair.Value.First();
3287
internal EntityKey GetPermanentKey(
IEntityWrapper
entityFrom, RelatedEnd relatedEndFrom,
IEntityWrapper
entityTo)
3302
private EntitySet GetEntitySetOfOtherEnd(
IEntityWrapper
entity, RelatedEnd relatedEnd)
3359
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> addedRelationshipsByGraph;
3360
HashSet<
IEntityWrapper
> entitiesToAdd = null;
3380
entitiesToAdd = entitiesToAdd != null ? entitiesToAdd : new HashSet<
IEntityWrapper
>();
3406
foreach (
IEntityWrapper
entityToAdd in entitiesToAdd)
3416
private void PerformAdd(
IEntityWrapper
wrappedOwner, RelatedEnd relatedEnd,
IEntityWrapper
entityToAdd, bool isForeignKeyChange)
3484
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> deletedRelationshipsByGraph;
3485
HashSet<
IEntityWrapper
> entitiesToDelete = null;
3498
IEntityWrapper
relatedEntity = null;
3525
entitiesToDelete = entitiesToDelete != null ? entitiesToDelete : new HashSet<
IEntityWrapper
>();
3566
foreach (
IEntityWrapper
entityToDelete in entitiesToDelete)
3601
private bool ShouldPreserveForeignKeyForPrincipal(
IEntityWrapper
entity, RelatedEnd relatedEnd,
IEntityWrapper
relatedEntity,
3602
HashSet<
IEntityWrapper
> entitiesToDelete)
3613
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> deletedRelationshipsByGraph;
3628
private bool ShouldPreserveForeignKeyForDependent(
IEntityWrapper
entity, RelatedEnd relatedEnd,
IEntityWrapper
relatedEntity,
3629
HashSet<
IEntityWrapper
> entitiesToDelete)
3636
private bool HasAddedReference(
IEntityWrapper
wrappedOwner, EntityReference reference)
3638
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> addedRelationshipsByGraph;
3639
HashSet<
IEntityWrapper
> entitiesToAdd = null;
3650
private bool IsReparentingReference(
IEntityWrapper
wrappedEntity, EntityReference reference)
3673
Dictionary<RelatedEnd, HashSet<
IEntityWrapper
>> addedRelationshipsByGraph;
3674
HashSet<
IEntityWrapper
> entitiesToAdd = null;
3717
Debug.Assert(!(entity is
IEntityWrapper
), "Object is an IEntityWrapper instance instead of the raw entity.");
System\Data\Objects\RelationshipEntry.cs (2)
504
IEntityWrapper
wrappedEntity1 = entry1.WrappedEntity;
506
IEntityWrapper
wrappedEntity2 = entry2.WrappedEntity;