public ResponseViewModel Delete(int id) { var response = new ResponseViewModel(); var pictureGroup = _pictureGroupDal.GetPictureGroup(p => p.Id == id); if (pictureGroup == null) { response.IsSuccess = false; response.Message = "PictureGroup bulunamadı."; return(response); } pictureGroup.IsDeleted = true; _pictureGroupDal.Update(pictureGroup); var saving = _pictureGroupDal.SaveChanges(); if (!saving) { response.IsSuccess = false; response.Message = "PictureGroup silme işlemi sırasında hata oluştu."; return(response); } response.Data = pictureGroup; return(response); }
public IResult Update(PictureGroup pictureGroup) { _pictureGroupDal.Update(pictureGroup); return(new SuccessResult(Messages.Updated)); }