Beispiel #1
0
        private bool IsValid(IAddCommentModel model)
        {
            Webpage webpage = GetWebpage(model);

            if (webpage == null)
            {
                return(false);
            }
            Comment comment = GetInReplyTo(model);

            return(comment == null || comment.Webpage == webpage);
        }
Beispiel #2
0
 private bool IsValid(IAddCommentModel model)
 {
     Webpage webpage = GetWebpage(model);
     if (webpage == null)
         return false;
     Comment comment = GetInReplyTo(model);
     return comment == null || comment.Webpage == webpage;
 }
Beispiel #3
0
 private Webpage GetWebpage(IAddCommentModel model)
 {
     return _session.Get<Webpage>(model.WebpageId);
 }
Beispiel #4
0
 private Comment GetInReplyTo(IAddCommentModel model)
 {
     return model.InReplyTo.HasValue
         ? _session.Get<Comment>(model.InReplyTo)
         : null;
 }
Beispiel #5
0
 private Webpage GetWebpage(IAddCommentModel model)
 {
     return(_session.Get <Webpage>(model.WebpageId));
 }
Beispiel #6
0
 private Comment GetInReplyTo(IAddCommentModel model)
 {
     return(model.InReplyTo.HasValue
         ? _session.Get <Comment>(model.InReplyTo)
         : null);
 }