protected virtual void Dispose(bool disposing)
 {
     if (!disposed)
     {
         UoW.Dispose();
         lotPhotoOperationsHandler.Dispose();
         if (disposing)
         {
             lotPhotoOperationsHandler = null;
             mapper = null;
             UoW    = null;
         }
     }
     disposed = true;
 }
        public LotOperationsHandler(IUnitOfWork unitOfWork, ILotPhotoOperationsHandler lotPhotoOperationsHandler)
        {
            mapper = new MapperConfiguration(cfg =>
            {
                cfg.CreateMap <LotEntity, Lot>()
                .ForMember(dest => dest.LotComments, opt => opt.Ignore())
                .ForMember(dest => dest.LotPhotos, opt => opt.Ignore())
                .ForMember(dest => dest.SellerUser, opt => opt.Ignore());
                cfg.CreateMap <UserAccountInfoEntity, UserAccountInfo>()
                .ForAllMembers(opt => opt.Ignore());
                cfg.CreateMap <LotPhotoEntity, LotPhoto>()
                .ForAllMembers(opt => opt.Ignore());
                cfg.CreateMap <LotCommentEntity, LotComment>()
                .ForAllMembers(opt => opt.Ignore());

                cfg.CreateMap <Lot, LotEntity>();
            }).CreateMapper();
            this.UoW = unitOfWork;
            this.lotPhotoOperationsHandler = lotPhotoOperationsHandler;
        }