JustBlog.Core.BlogRepository.Post C# (CSharp) Method

Post() public method

Return post based on the published year, month and title slug.
public Post ( int year, int month, string titleSlug ) : JustBlog.Core.Objects.Post
year int Published year
month int Published month
titleSlug string Post's url slug
return JustBlog.Core.Objects.Post
        public Post Post(int year, int month, string titleSlug)
        {
            /*return _session.Query<Post>()
                     .Where(p => p.PostedOn.Year == year && p.PostedOn.Month == month && p.UrlSlug.Equals(titleSlug))
                     .Fetch(p => p.Category)
                     .FetchMany(p => p.Tags)
                     .FirstOrDefault();*/

              var query = _session.Query<Post>()
                     .Where(p => p.PostedOn.Year == year && p.PostedOn.Month == month && p.UrlSlug.Equals(titleSlug))
                     .Fetch(p => p.Category);

              query.FetchMany(p => p.Tags).ToFuture();

              return query.ToFuture().Single();
        }

Same methods

BlogRepository::Post ( int id ) : JustBlog.Core.Objects.Post