//public ResponseModel<Photo> Update(Photo entity,IFormFile file) //{ // try // { // responseModel.result = entity; // _logger.Log(LogLevel.Information, "Fotoğraf güncellendi"); // var result = FileStorageHelper.UpdateFile(file,entity.PhotoUrl); // entity.PhotoUrl = result.Message; // responseModel.Success = _photoDAL.Update(entity); // return responseModel; // } // catch (Exception ex) // { // _logger.LogError(ex, ex.Message + "Fotoğraf güncelleme hatası"); // responseModel.Success = false; // responseModel.Message = ex.Message; // return responseModel; // } //} public ResponseModel <Photo> Delete(Photo entity) { try { responseModel.Success = _photoDAL.Delete(entity); if (responseModel.Success) { FileStorageHelper.DeleteFile(entity.PhotoUrl); return(responseModel); } return(responseModel); } catch (Exception ex) { _logger.LogError(ex, ex.Message + "Fotoğraf silme hatası"); responseModel.Success = false; responseModel.Message = ex.Message; return(responseModel); } }
public bool Delete(PhotoInfo model) { return(dal.Delete(model)); }
public bool Delete(Photo model) { return(_PhotoDAL.Delete(model) > 0); }