/// <summary> /// Initializes a new instance of the ViewPostViewModel class /// </summary> /// <param name="blogPost">The BlogPost to view</param> /// <param name="comments">Any user comments associated with the blog post</param> /// <param name="averageRating">Specifies the average user rating for the post</param> /// <param name="totalRatings">Specifies the total number of user ratings for the current post</param> public ViewPostViewModel(BlogPost blogPost, IList<UserComment> comments, int averageRating, int totalRatings) { Post = blogPost; Comments = comments; AverageRating = averageRating; TotalRatings = totalRatings; }
/// <summary> /// Deprecated Method for adding a new object to the BlogPosts EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToBlogPosts(BlogPost blogPost) { base.AddObject("BlogPosts", blogPost); }
/// <summary> /// Create a new BlogPost object. /// </summary> /// <param name="blogPostId">Initial value of the BlogPostId property.</param> /// <param name="visible">Initial value of the Visible property.</param> public static BlogPost CreateBlogPost(global::System.Guid blogPostId, global::System.Boolean visible) { BlogPost blogPost = new BlogPost(); blogPost.BlogPostId = blogPostId; blogPost.Visible = visible; return blogPost; }