【问题标题】:Where can I find the list of all the interfaces commonly used by MyGeneration?在哪里可以找到 MyGeneration 常用的所有接口的列表?
【发布时间】:2011-06-29 14:18:54
【问题描述】:

在哪里可以找到 MyGeneration 常用的所有接口的列表?

(我特别要求它学习使用 foreach 循环遍历我的数据库中的所有表)

【问题讨论】:

    标签: c# .net mygeneration


    【解决方案1】:

    如果您询问MyGeneration Code Generator,您可能需要找到here in the My Generation svn Repository 的数据库模型接口

    【讨论】:

      【解决方案2】:

      我希望你有一些通用的方法来识别你的实体类(比如一个通用的基类,或者实现的接口)。然后你可以做一个反射查询,比如:

      from t in typeof(Entity).Assembly.ExportedTypes
      where typeof(Entity).IsAssignableFrom(t) || t.GetInterfaces.Any(i => i == typeof(CommonInterface))
      select t
      

      手头没有编译器,但这是大方向。

      【讨论】:

        猜你喜欢
        • 2021-10-09
        • 2010-10-09
        • 1970-01-01
        • 2010-10-17
        • 2010-11-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多