Exemplo n.º 1
0
 private static void valid_comment_submission(BlogPostCommentViewModel inModel, BlogPostViewModel result)
 {
     // TODO: have attributes on the viewmodel and do validation elsewhere
     if (inModel.UserDisplayName.IsEmpty())
     {
         result.AddInvalidField <BlogPostCommentViewModel>(x => x.UserDisplayName);
     }
     if (inModel.UserEmail.IsEmpty())
     {
         result.AddInvalidField <BlogPostCommentViewModel>(x => x.UserEmail);
     }
     if (inModel.Body.IsEmpty())
     {
         result.AddInvalidField <BlogPostCommentViewModel>(x => x.Body);
     }
 }