public override bool Equals(object obj) { MapperContextKey other = obj as MapperContextKey; return(other != null && Equals(other.EntityType, EntityType) && Equals(other.KeyValue, KeyValue)); }
public TEntity OnMapperAction <TEntity, TSource, TKey>(TEntity entity, TSource source, TKey key, MapperActionType actionType) where TEntity : class where TSource : class where TKey : IEntityKey { MapperContextKey mapperKey = new MapperContextKey(typeof(TEntity), key); _entries.AddOrUpdate(mapperKey, key => { return(new MapperContextEntry { Entity = entity, ActionType = actionType }); }, (key, entry) => { entry.ActionType = actionType; return(entry); }); return(entity); }