public TriggerContext(object entity, PropertyValues?originalValues, ChangeType changeType, EntityBagStateManager entityBagStateManager)
 {
     _entity                = (TEntity)entity;
     _originalValues        = originalValues;
     _type                  = changeType;
     _entityBagStateManager = entityBagStateManager;
 }
Пример #2
0
        public void GetForEntity_MultipleCallsForSameEntity_ReturnsSameInstance()
        {
            var subject     = new EntityBagStateManager();
            var entity      = new object();
            var expectedBag = subject.GetForEntity(entity);

            var bag = subject.GetForEntity(entity);

            Assert.Same(expectedBag, bag);
        }
Пример #3
0
        public void GetForEntity_MultipleCallsForDifferentEntities_ReturnsDifferentInstances()
        {
            var subject = new EntityBagStateManager();
            var entity1 = new object();
            var entity2 = new object();

            var entity1Bag = subject.GetForEntity(entity1);
            var entity2Bag = subject.GetForEntity(entity2);

            Assert.NotSame(entity1Bag, entity2Bag);
        }