public async Task IncludeMainPhoto(IMainPhotoUploadable entity, int entityTypeId) { var photoSpecification = new PhotoFilterSpecification(entityTypeId, entity.Id, isMain: true); var photo = await _uow.Repository <Domain.Entities.Photo>().FindOneAsync(photoSpecification); entity.MainPhoto = _mapper.Map <PhotoForDetailedDto>(photo); }
private void InitializeObjects() { _service = new PhotoService(_cloudUploadService.Object, _mapper.Object, _uow.Object); _photoForCreation = new PhotoForCreationDto { File = new Mock <IFormFile>().Object, Description = "description", EntityTypeId = (int)EntityTypes.Film, EntityId = 1 }; _uploadResult = new PhotoCloudUploadResult { PublicId = "PublicId", Url = "Url" }; _photo = new Domain.Entities.Photo(); _mainPhoto = new Domain.Entities.Photo(); _photos = new List <Domain.Entities.Photo>(); _photosForDetailed = new List <PhotoForDetailedDto> { new PhotoForDetailedDto { }, new PhotoForDetailedDto { } }; _mainPhotoUploadable = new MainPhotoUploadable { Id = 1 }; }