我有一个基地实体A和衍生实体:AA、AB、AC、AD
context.A.GroupBy(x => x.GetType()).Select(x => new { type=x.GetType(), count = x.Count() });
我当然会犯错:
LINQ to Entities does not recognize the method System.Type GetType() method, and this method cannot be translated into a store expression.
如何按类型对衍生实体进行分类?