I am trying to sort different field. i.e. blogID, date, author I found order by method but dont know how to pass the value in the method... help please
public List<blog> BlogFetch(string key)
{
List<blog> blogRes = new List<blog>();
using (var be = new BlogEntities())
{
blog res = new blog();
foreach (var User in be.blogs.OrderBy(<what goes here?>))
{
res = User;
blogRes.Add(res);
}
}
return blogRes;
}