public void FromBltoUiEditAsync(PhotoViewModel Photo) { var editMap = Mapper.Map <PhotoViewModel, Photo>(Photo); _photoRepository.EditAsync(editMap); }
//public List<PhotoViewModel> FromBlToUiGetApartList() //{ // var getData = _genericRepository.GetAll() // //.Include(a => new Adress() {Id = a.Adress.Id, Street = a.Adress.Street}) // //.Include(a => new HousingType() {Id = a.Housing.Id, Type = a.Housing.Type}) // //.Include(a => new District() {Id = a.District.Id, Name = a.District.Name}) // //.Include(x => x.Features.Select(s => new Features() { Id = s.Id, name = s.name })) // .Select(p => new AppartmentViewModel() // { // Id = p.Id, // Area = p.Area, // Rent = p.Rent, // NrOfRooms = p.NrOfRooms, // BuildinFloors = p.BuildinFloors, // Floor = p.Floor, // BuildYear = p.BuildYear, // MoveInDate = p.MoveInDate, // LastAdmissionDate = p.LastAdmissionDate, // PublicationDate = p.PublicationDate, // Avalible = p.Avalible, // //Adress = new AdressViewModel() { Id = p.Adress.Id, Street = p.Adress.Street }, // //Housing = new HousingTypeViewModel() { Id = p.Housing.Id, Type = p.Housing.Type }, // //District = new DistrictViewModel() { Id = p.District.Id, Name = p.District.Name, Description = p.District.Description } // }) // .ToList(); // return getData; //} public async Task FromBltoUiEditAsync(PhotoViewModel Photo) { var editMap = Mapper.Map <PhotoViewModel, Photo>(Photo); await _photoRepository.EditAsync(editMap); }