Fluent Nhibernate No Persistor for Class Name

2019-08-18 08:00发布

问题:

I am getting this error even though all my mappings are pretty simple and correct. I get this error only on select classes. Can someone help?

回答1:

This error occurs since the class is not public. Just change the class to public and this won't occur again. However, if you do not want to expose the assembly outside the Assembly you can still mark the constructor as 'internal'.

The only downside to it is that the class shows up in intellisense. However, you would get a compile time error if you try to use it. So that should not be a problem.

For more details http://weblogs.asp.net/chanderdhall/archive/2010/09/09/no-persister-for-lt-classname-gt.aspx