public void CreateComment(CommentTransport model) { model.CreatedAt = DateTime.UtcNow.ToString("d"); var comment = Mapper.Map <CommentTransport, Comment>(model); database.Comments.Create(comment); database.Save(); }
public void UpdateComment(CommentTransport model) { var comment = database.Comments.Get(model.Id); comment.Content = model.Content; database.Comments.Update(comment); database.Save(); }