I want my search to return Random entries from database.How to do this?
This is my search function where i am using Join query and have taken a new model to pass Attributes.
var planetfeedsOrder = from a in db.PlanetFeeds
where a.PlanetFeedOwnerId == id || a.PlanetFeedPosterId == id
&& a.CurrentState != 1
join c in db.Graphs on a.PlanetFeedItemGraphId equals c.GraphID
join u in db.UserInfos on a.PlanetFeedOwnerId equals u.UserInfoID
orderby a.PostDate descending
select new UserInfoViewModel
{
AvatarURL = u.AvatarURL,
UserName=u.FirstName +" "+u.LastName,
GraphItemDescription = c.GraphItemDescription,
GraphItemURL = c.GraphItemURL,
isRootFeed = a.isRootFeed,
PostDate = a.PostDate,
CurrentState = a.CurrentState,
};
return PartialView("_PlanetfeedPartial",planetfeedsOrder.Take(itemCount).ToList());