예제 #1
0
        public IDbPropertyValuesBase Clone()
        {
            MockDbPropertyValues clone = new MockDbPropertyValues();

            foreach (string key in _properties.Keys)
            {
                clone[key] = _properties[key];
            }

            return(clone);
        }
예제 #2
0
        public MockDbEntityEntry(TEntity entity)
        {
            _entity = entity;

            _originalPropertyValues = new MockDbPropertyValues();
            _currentPropertyValues  = new MockDbPropertyValues();
            PropertyInfo[] properties = typeof(TEntity).GetProperties(BindingFlags.Public);
            foreach (PropertyInfo propertyInfo in properties)
            {
                object value = propertyInfo.GetValue(_entity);
                _originalPropertyValues[propertyInfo.Name] = value;
                _currentPropertyValues[propertyInfo.Name]  = value;
            }
        }