public async Task <Comments> CreateComment(Comments entity)
        {
            entity.CommentTime = DateTime.Now;
            await _comments.Create(entity);

            return(_comments.WhereByUserId(entity.UserId).Result.Last());
        }
Example #2
0
        public Repositories(string connection)
        {
            #region Data context creating
            // ReSharper disable UseObjectOrCollectionInitializer
            _Context = new TimezDataContext(connection);
            // ReSharper restore UseObjectOrCollectionInitializer
#if DEBUG
            _Context.CommandTimeout = 60 * 5;
            _Context.Log            = new DebuggerWriter();
#endif
            #endregion

            Boards        = BoardsRepository.Create(_Context);
            BoardsColors  = BoardsColorsRepository.Create(_Context);
            BoardsUsers   = BoardsUsersRepository.Create(_Context);
            Tasks         = TasksRepository.Create(_Context);
            TasksStatuses = TasksStatusesRepository.Create(_Context);
            Users         = UsersRepository.Create(_Context);
            Organizations = OrganizationsRepository.Create(_Context);
            Projects      = ProjectsRepository.Create(_Context);
            Comments      = CommentsRepository.Create(_Context);
            EventHistory  = EventHistoryRepository.Create(_Context);
            Invites       = InvitesRepository.Create(_Context);
            Texts         = TextsRepository.Create(_Context);
        }
Example #3
0
        public int CreateNewComment(string comment)
        {
            var commentDAL = new Comments()
            {
                Comment = comment
            };
            int id = commentRepository.Create(commentDAL);

            return(id);
        }
Example #4
0
 internal Comment Create(Comment newComment)
 {
     return(_repo.Create(newComment));
 }
 public Comment Create(Comment newComment)
 {
     return(_repo.Create(newComment));
 }
Example #6
0
 internal Comment Create(Comment newComment)
 {
     newComment.Id = _cr.Create(newComment);
     return(newComment);
 }
 public Comment Create(Comment newComment)
 {
     newComment.Id = _repo.Create(newComment);
     return(newComment);
 }
 // POST: api/ManagerComment
 public void Post(ManagerComment comment)
 {
     CommentsRepository.Create(comment);
 }
 // POST: api/ManagerComment
 public void Post(managercomments comment)
 {
     CommentsRepository.Create(comment);
 }