Skip to content

Instantly share code, notes, and snippets.

@JohannesSundqvist
Created March 28, 2017 17:21
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/a4744d24da0e55bd3110ffaef39dda39 to your computer and use it in GitHub Desktop.
Save JohannesSundqvist/a4744d24da0e55bd3110ffaef39dda39 to your computer and use it in GitHub Desktop.
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,
Category = p.Category,
}).Distinct();
return query;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment