public async Task <BasexResponse <Comment> > CreateAsync(Comment comment)
        {
            try
            {
                comment.CreationTime = DateTime.UtcNow;
                await _commentDal.AddAsync(comment);

                await _unitOfWork.CompleteAsync();

                return(new BasexResponse <Comment>(comment));
            }
            catch (Exception ex)
            {
                return(new BasexResponse <Comment>(ex.Message));
            }
        }
Пример #2
0
        public async Task <IResult> AddAsync(Comment entity)
        {
            await _commentDal.AddAsync(entity);

            return(new SuccessResult());
        }
Пример #3
0
        public async Task <IResult> Add(CommentForAddUpdateDto dto)
        {
            await _commentDal.AddAsync(dto.Map <Comment>());

            return(new SuccessResult(Messages.AddedSuccessfully));
        }