我有这个在我的WCF域名服务:如何加载非实体查询?
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();
}
现在我想将其加载到我的视图模型是这样的:
context.Load(context.GetTop5ActiveUsersByManagementMessages(),
GetActiveUsersCallback, true);
然而,抱怨需要明确指定类型。我该如何解决?
什么类型的对象是上下文,DataContext? – Amasuriel 2011-06-10 19:57:10
@Amasuriel DomainContext – 2011-06-10 20:24:05