public Task <CommentFlatOwnerFamily> New(CommentFlatOwnerFamily comment, ApplicationUser currentuser)
        {
            var taskResult = Task.Run(() =>
            {
                using (var context = new DbContext())
                {
                    comment.CommentBy = currentuser.Name;

                    context.CommentFlatOwnerFamilies.Add(comment);
                    context.SaveChanges();

                    return(comment);
                }
            });

            return(taskResult);
        }
        public Task Update(CommentFlatOwnerFamily comment)
        {
            var taskResult = Task.Run(() =>
            {
                using (var context = new DbContext())
                {
                    var cd = context.CommentFlatOwnerFamilies.FirstOrDefault(c => c.Id == comment.Id);

                    if (cd != null && cd.CreatedBy.Equals(Thread.CurrentPrincipal.Identity.Name))
                    {
                        cd.Text = comment.Text;
                        context.SaveChanges();
                    }
                }
            });

            return(taskResult);
        }
 public Task Update(CommentFlatOwnerFamily comment)
 {
     return(_commentRepository.Update(comment));
 }
 public Task <CommentFlatOwnerFamily> New(CommentFlatOwnerFamily comment, ApplicationUser currentuser)
 {
     return(_commentRepository.New(comment, currentuser));
 }