Skip to content

Instantly share code, notes, and snippets.

@JohannesSundqvist
Created March 28, 2017 17:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JohannesSundqvist/d9823db1965b0b075b92494144945dd1 to your computer and use it in GitHub Desktop.
Save JohannesSundqvist/d9823db1965b0b075b92494144945dd1 to your computer and use it in GitHub Desktop.
public IQueryable<Post> GetCategories()
{
var query = (from p in Post
select new Post
{
Category = p.Category,
}).Distinct();
return query;
}
public IQueryable<Post> GetPost()
{
var query = (from p in Post
select new Post
{
Id = p.Id,
Header = p.Header,
Text = p.Text,
DateCreated = p.DateCreated,
Thumbnail = p.Thumbnail,
});
return query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment