Exemplo n.º 1
0
 public IDataResult <List <Comment> > GetAll()
 {
     try
     {
         return(new SuccessDataResult <List <Comment> >(_commentDal.GetList(), Messages.SuccessGetList));
     }
     catch (Exception)
     {
         return(new ErrorDataResult <List <Comment> >(Messages.ErrorGetList));
     }
 }
Exemplo n.º 2
0
 public List <Comment> GetList(Expression <Func <Comment, bool> > filter = null, params string[] includeList)
 {
     try
     {
         return(commentDal.GetList(filter, includeList));
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Exemplo n.º 3
0
        public IDataResult <List <CommentDto> > GetByProductId(int productId)
        {
            var commentList    = _commentDal.GetList(c => c.ProductId == productId);
            var commentDtoList = new List <CommentDto>();

            foreach (var comment in commentList)
            {
                var user = _userService.GetById(comment.UserId).Data;
                commentDtoList.Add(new CommentDto
                {
                    Comment  = comment,
                    FullName = user.FirstName + " " + user.LastName
                });
            }
            return(new SuccessDataResult <List <CommentDto> >(commentDtoList));
        }
 public EntityResult <List <Comment> > GetList(Expression <Func <Comment, bool> > filter = null, params string[] includeList)
 {
     try
     {
         var comments = _commentDal.GetList(filter, includeList);
         if (comments != null)
         {
             return(new EntityResult <List <Comment> >(comments, "Başarılı", ResultState.Success));
         }
         return(new EntityResult <List <Comment> >(null, "Hata Oluştu", ResultState.Warning));
     }
     catch (Exception ex)
     {
         return(new EntityResult <List <Comment> >(null, "Database Hatası " + ex.ToInnestException().Message, ResultState.Error));
     }
 }
Exemplo n.º 5
0
        public List <CommentDto> GetList(Expression <Func <Comment, bool> > expression = null)
        {
            var result  = new List <CommentDto>();
            var getList = _commentDal.GetList(expression);

            foreach (var item in getList)
            {
                var dtoComment = new CommentDto()
                {
                    CommentDate = item.CommentDate,
                    Content     = item.Content,
                    Id          = item.Id,
                    IsActive    = item.IsActive,
                    PostId      = item.PostId,
                    UserId      = item.UserId
                };
            }
            return(result);
        }
Exemplo n.º 6
0
        public DataResponse GetList()
        {
            var comment = _commentDal.GetList();

            if (comment == null)
            {
                return new DataResponse
                       {
                           Mesaj      = "Aradiginiz Yorum Getirilemedi",
                           Tamamlandi = false
                       }
            }
            ;
            return(new DataResponse
            {
                Data = comment,
                Mesaj = "Yorumlar Getirildi",
                Tamamlandi = true
            });
        }
 public List <Comment> GetAll()
 {
     return(_commentDal.GetList());
 }
 public List <Comment> GetByPost(int postId)
 {
     return(_commentDal.GetList(p => p.PostId == postId));
 }
Exemplo n.º 9
0
 public List <Comment> GetList(Expression <Func <Comment, bool> > expression = null)
 {
     return(_commentDal.GetList(expression));
 }
Exemplo n.º 10
0
 public IDataResult <List <Comment> > GetList()
 {
     return(new SuccessDataResult <List <Comment> >(_commentDal.GetList().ToList()));
 }
Exemplo n.º 11
0
 public List <Comment> GetList(Expression <Func <Comment, bool> > filter = null)
 {
     return(filter == null
         ? _commentDal.GetList()
         : _commentDal.GetList(filter));
 }
Exemplo n.º 12
0
 public List <Comments> GetList(Expression <Func <Comments, bool> > filter = null)
 {
     return(_commentDal.GetList(filter));
 }
Exemplo n.º 13
0
        public IDataResult <List <Comment> > GetAll()
        {
            var model = _commentDal.GetList();

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