//hostingEnvironmentPath - physical path to WebAPI folder //requestUriLeftPart - URL public void DeleteLot(int lotId, string hostingEnvironmentPath, string requestUriLeftPart) { Lot lot = GetLot(lotId); //Don`t use cascade deleting, because photos must be deleted as well lotPhotoOperationsHandler.DeleteAllLotPhotos(lot.Id, hostingEnvironmentPath, requestUriLeftPart); UoW.Lots.Delete(lotId); UoW.SaveChanges(); }