Пример #1
0
        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);
        }
Пример #2
0
 public IResult Update(PictureGroup pictureGroup)
 {
     _pictureGroupDal.Update(pictureGroup);
     return(new SuccessResult(Messages.Updated));
 }