public void DeletePhoto(string path) { PhotoForGallery photo = (from u in _testStoreContext.PhotoForGalleries where u.UrlImage == path select u).FirstOrDefault(); _testStoreContext.PhotoForGalleries.Remove(photo); }
public void AddPhotoForGallery(PhotoForGalleryDTO photoDto) { var photo = new PhotoForGallery() { RealEstateId = photoDto.RealEstateId, UrlImage = photoDto.UrlImage, }; _testStoreContext.PhotoForGalleries.Add(photo); }