I have this in my WCF domain service:
public List<string> GetTop5ActiveUsersByManagementMessages()
{
return this.ObjectContext.Logs
.Where(w => w.Message == "Created User" ||
w.Message == "Removed User" || w.Message == "Updated User")
.GroupBy(w => w.Username)
.OrderByDescending(g => g.Count())
.Select(s => s.Key)
.Take(5).ToList();
}
Now I want to load it in my view model like this:
context.Load(context.GetTop5ActiveUsersByManagementMessages(),
GetActiveUsersCallback, true);
However, it complains about needing to specify the types explicitly. How do I fix this?
‘Non-entity queries’ aren’t actually a thing. What you’ve written is an ‘Invoke’ operation. You just need to call it differently from the client.