• Nhibernate 抛出异常 System.Collections.Generic.KeyNotFoundException 给定关键字不在字典中


     这个问题困扰今天一上午。

     每次F5 都会停在
    press F5 stop this

     private static readonly ISessionFactory sessionFactory = configuration.BuildSessionFactory();

     然后抛出
    then throw exception

     System.Collections.Generic.KeyNotFoundException 给定关键字不在字典中

    System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

    这个异常。
    this exception

    最后发现 在做model类的时候好几个 Employee 被我打成了Employye 导致了这个异常。 上午搜了 解决的方法不多。特在此留下记号

    如果你也遇到同样的错误。请仔细检查你的实体类。

     

    Solution: Check entity class and hbm.xml files

     

    英语烂的不行,上google 搜索发现外国朋友也有许多遇到同样问题的。也都没有解决, 所以写下中英的希望外国的朋友能看懂我的中国英语!

  • 相关阅读:
    PS
    div 解决高度塌陷
    gradle Error:Cause: unable to find valid certification path to requested target
    HTML
    前端路线图
    css 选择器
    css-day01
    Python图像处理 | 把图像中的白色变成透明
    X-Frame-Options(点击劫持)
    python两张图片显示在一张图上
  • 原文地址:https://www.cnblogs.com/dsktt/p/1513211.html
Copyright © 2020-2023  润新知