Exemplo n.º 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));
     }
 }
Exemplo n.º 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)));
        }
Exemplo n.º 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));
        }
Exemplo n.º 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));
     }
 }
Exemplo n.º 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
            });
        }
Exemplo n.º 8
0
 public IDataResult <Comment> GetById(int Id)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == Id), Messages.CommentGetted));
 }
Exemplo n.º 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));
 }
Exemplo n.º 11
0
 public Comments Get(Expression <Func <Comments, bool> > filter = null)
 {
     return(_commentDal.Get(filter));
 }
Exemplo n.º 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));
 }
Exemplo n.º 14
0
 public Comment Get(Expression <Func <Comment, bool> > filter)
 {
     return(_commentDal.Get(filter));
 }
Exemplo n.º 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();
 }
Exemplo n.º 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));
 }
Exemplo n.º 19
0
 public IDataResult <Comment> GetById(int commentID)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(p => p.ID == commentID)));
 }
Exemplo n.º 20
0
 public Comment GetCommentsById(int commentId)
 {
     return(_commentDal.Get(x => x.CommentId == commentId));
 }
Exemplo n.º 21
0
 public IDataResult <Comment> GetById(int commentId)
 {
     return(new SuccessDataResult <Comment>(_commentDal.Get(c => c.Id == commentId)));
 }
Exemplo n.º 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));
 }
Exemplo n.º 24
0
        public IDataResult <Comment> GetComment(int commentId)
        {
            var model = _commentDal.Get(i => i.Id == commentId);

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