Created
August 1, 2020 13:35
-
-
Save LANSELOT/905973aa495ef43754fd2cd6b2387d11 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
postsQueryable = | |
context.Posts | |
.Include(x => x.Section) | |
.Include(x => x.PostTags).ThenInclude(x => x.Tag) | |
.Where(x => x.IsPublished) | |
.Select(x => new Post | |
{ | |
Title = x.Title, | |
Slug = x.Slug, | |
Cover = x.Cover, | |
ContentShort = x.ContentShort, | |
CreatedDate = x.CreatedDate, | |
SectionId = x.SectionId, | |
Section = x.Section, | |
IsPublished = x.IsPublished, | |
PostTags = x.PostTags, | |
SeoTitle = x.SeoTitle, | |
SeoKeywords = x.SeoKeywords, | |
SeoDescription = x.SeoDescription, | |
}).OrderBy(on => on.CreatedDate) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment