Пример #1
0
 public IDataResult <Comment> GetById(int commentId)
 {
     try
     {
         return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == commentId), Messages.SuccessGetById));
     }
     catch (Exception)
     {
         return(new ErrorDataResult <Comment>(Messages.ErrorGetById));
     }
 }
Пример #2
0
        public IDataResult <Comment> GetById(int id)
        {
            IResult result = BusinessRule.Run
                             (
                CheckIfCommentExist(id)
                             );

            if (result != null)
            {
                return(new ErrorDataResult <Comment>(result.Message));
            }

            return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == id)));
        }
Пример #3
0
 public bool DeleteComment(int id)
 {
     try
     {
         var comment = _commentDal.Get(x => x.Id == id);
         _commentDal.Delete(comment);
         _commentDal.Save();
         return(true);
     }
     catch (Exception exp)
     {
         return(false);
     }
 }
        public IDataResult <Comment> Get(int id)
        {
            var comment = _commentDal.Get(x => x.Id == id);

            if (comment != null)
            {
                return(new SuccessDataResult <Comment>(comment));
            }
            return(new ErrorDataResult <Comment>(Messages.Get));
        }
Пример #5
0
 public Comment Get(Expression <Func <Comment, bool> > filter, params string[] includeList)
 {
     try
     {
         return(commentDal.Get(filter, includeList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
 public EntityResult <Comment> Get(Expression <Func <Comment, bool> > filter, params string[] includeList)
 {
     try
     {
         var comment = _commentDal.Get(filter, includeList);
         if (comment != null)
         {
             return(new EntityResult <Comment>(comment, "Başarılı", ResultState.Success));
         }
         return(new EntityResult <Comment>(null, "Hata oluştu", ResultState.Warning));
     }
     catch (Exception ex)
     {
         return(new EntityResult <Comment>(null, "Database Hatası " + ex.ToInnestException().Message, ResultState.Error));
     }
 }
Пример #7
0
        public DataResponse Get(int id)
        {
            var comment = _commentDal.Get(i => i.ID == id);

            if (comment == null)
            {
                return new DataResponse
                       {
                           Mesaj      = "Aradiginiz Yorum Bulunamadi",
                           Tamamlandi = false
                       }
            }
            ;
            return(new DataResponse
            {
                Data = comment,
                Mesaj = "Yorum Getirildi",
                Tamamlandi = true
            });
        }
Пример #8
0
 public IDataResult <Comment> GetById(int Id)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == Id), Messages.CommentGetted));
 }
Пример #9
0
 public IDataResult <Comment> Get(int id)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == id)));
 }
 public Comment GetById(int id)
 {
     return(_commentDal.Get(c => c.CommentId == id));
 }
Пример #11
0
 public Comments Get(Expression <Func <Comments, bool> > filter = null)
 {
     return(_commentDal.Get(filter));
 }
Пример #12
0
 public Comment Get(int id)
 {
     return(_commentDal.Get(p => p.Id == id));
 }
 public Comment GetByItem(object item)
 {
     return(_commentDal.Get(c => c.CommentId == (int)item));
 }
Пример #14
0
 public Comment Get(Expression <Func <Comment, bool> > filter)
 {
     return(_commentDal.Get(filter));
 }
Пример #15
0
 public Comment Get(int id)
 {
     return(_commentDal.Get(c => c.Id == id));
 }
 public IResult Delete(int id)
 {
     var value = _commentDal.Get(x => x.Id == id);
     _commentDal.Delete(value);
     return new SuccessResult();
 }
Пример #17
0
 public Comment Get(int id)
 {
     return(commentDal.Get(x => x.ID == id));
 }
 public Comment Get(int Id)
 {
     return(_CommentDal.Get(x => x.Id == Id));
 }
Пример #19
0
 public IDataResult <Comment> GetById(int commentID)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(p => p.ID == commentID)));
 }
Пример #20
0
 public Comment GetCommentsById(int commentId)
 {
     return(_commentDal.Get(x => x.CommentId == commentId));
 }
Пример #21
0
 public IDataResult <Comment> GetById(int commentId)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == commentId)));
 }
Пример #22
0
        public void Delete(int id)
        {
            var value = _commentDal.Get(x => x.Id == id);

            _commentDal.Delete(value);
        }
 public Comment GetById(int commendId)
 {
     return(_commentDal.Get(c => c.Id == commendId));
 }
Пример #24
0
        public IDataResult <Comment> GetComment(int commentId)
        {
            var model = _commentDal.Get(i => i.Id == commentId);

            return(new SuccessDataResult <Comment>(model, Messages.Success));
        }