コード例 #1
0
 /// <summary>
 /// Удаление комментария
 /// </summary>
 /// <param name="comment"></param>
 public void Delete(CommentViewModel comment)
 {
     commentsRepository.Delete(Convert(comment));
 }
コード例 #2
0
 /// <summary>
 /// Редактирование комментария
 /// </summary>
 /// <param name="category"></param>
 public void Edit(CommentViewModel commentView)
 {
     commentView.UpdatedDate = DateTime.Now;
     commentsRepository.Add(Convert(commentView));
 }
コード例 #3
0
 /// <summary>
 /// Конвертационные функции
 /// </summary>
 private Models.Comment Convert(CommentViewModel c)
 {
     return new Models.Comment()
     {
         Id = c.Id,
         CreatedDate = c.CreatedDate,
         UpdatedDate = c.UpdatedDate,
         Text = c.Text,
         CustomerId = c.CustomerId,
         ProductId = c.ProductId
     };
 }