0

我有一堆表,它们都有相同的列,称为 Guid 类型的 SessionID,这是创建实体的会话的 ID。我正在尝试编写一个通用类,它将计算特定会话和特定实体的实体类型。有没有人用 LLBLGen 做过类似的事情?

public class EntityCounterControl<T> where T : EntityBase2, IEntity2
{       
    public int CountEntities(Guid sessionID)
    {
        //How can I count the entities for type T?

    }
}; 
4

1 回答 1

0

你真的需要使用泛型吗?您可以创建一个定义 SessionId 属性的接口并让您的实体实现它。

于 2012-03-26T07:20:36.133 回答