public IDataResult <List <Comment> > GetAll() { try { return(new SuccessDataResult <List <Comment> >(_commentDal.GetList(), Messages.SuccessGetList)); } catch (Exception) { return(new ErrorDataResult <List <Comment> >(Messages.ErrorGetList)); } }
public List <Comment> GetList(Expression <Func <Comment, bool> > filter = null, params string[] includeList) { try { return(commentDal.GetList(filter, includeList)); } catch (Exception ex) { throw ex; } }
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)); } }
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); }
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)); }
public List <Comment> GetList(Expression <Func <Comment, bool> > expression = null) { return(_commentDal.GetList(expression)); }
public IDataResult <List <Comment> > GetList() { return(new SuccessDataResult <List <Comment> >(_commentDal.GetList().ToList())); }
public List <Comment> GetList(Expression <Func <Comment, bool> > filter = null) { return(filter == null ? _commentDal.GetList() : _commentDal.GetList(filter)); }
public List <Comments> GetList(Expression <Func <Comments, bool> > filter = null) { return(_commentDal.GetList(filter)); }
public IDataResult <List <Comment> > GetAll() { var model = _commentDal.GetList(); return(new SuccessDataResult <List <Comment> >(Messages.Success)); }