代码之家  ›  专栏  ›  技术社区  ›  David

IClassMap从哪个版本开始

  •  0
  • David  · 技术社区  · 14 年前

    我试着跟着这一页 http://jagregory.com/writings/fluent-nhibernate-conventions-rewrite/ 定义Fluent NHibernate的约定。

    我使用的是1.1.0.685,当我使用此代码时:

    public class TableNameConvention : IClassConvention
    {
      public bool Accept(IClassMap classMap)
      {
        return true; // apply to all mappings
      }
    
      public void Apply(IClassMap classMap)
      {
        // will produce table names like: tbl_Customer, tbl_Product
        classMap.WithTable("tbl_" + classMap.EntityType.Name);
      }
    }
    

    编译器不知道什么是IClassMap。IClassConvention是的,IClassMap不是。我没有从Visual Studio得到任何命名空间建议。

    我的FNH副本是最新的,邮寄时间是3月11日。是我的版本过时了,还是有别的事情发生了?

    1 回复  |  直到 14 年前
        1
  •  0
  •   mhenrixon    14 年前

    你想要的是 IClassInstance实例 .

     public void Apply(IClassInstance classMap)
      {
        // will produce table names like: tbl_Customer, tbl_Product
        classMap.Table("tbl_" + classMap.EntityType.Name);
      }