Ejemplo n.º 1
0
        public static TDbObject MapToDbObject <TDbObject>(IMapper mapper,
                                                          MappingManager mappingManager,
                                                          DDDBuildingBlock entity,
                                                          Func <DDDBuildingBlock, bool> equalityComparer = null)
        {
            if (entity is not DDDBuildingBlock)
            {
                throw new ArgumentException($"{nameof(entity)} is not ${nameof(DDDBuildingBlock)} type");
            }

            if (mappingManager.MappingExist(entity, equalityComparer))
            {
                var fromContext = mappingManager.GetRelation <TDbObject>(entity, equalityComparer);
                mapper.Map(entity, fromContext);
                return(fromContext);
            }

            return(mapper.Map <TDbObject>(entity));
        }
Ejemplo n.º 2
0
 protected EntityCollectionResolver(MappingManager mappingManager, IMapper mapper)
 {
     _mappingManager = mappingManager;
     _mapper         = mapper;
 }
Ejemplo n.º 3
0
 protected EntityMapper(IMapper mapper, MappingManager mappingManager)
 {
     _mapper         = mapper;
     _mappingManager = mappingManager;
 }
 protected EntityOneDDDToManyDbResolver(MappingManager mappingManager, IMapper mapper)
 {
     _mappingManager = mappingManager;
     _mapper         = mapper;
 }