“No Persister For” error in Nhibernate

Hello Friends

I was running into some other problem and I wanted to test some thins so I have quickly created a small solution.I did all the required steps and run it ..and voilaaa…

i have this small cute error (because its a really small text 🙂 ) It says “No Persister for :….

I get this error when try to save object or SaveUpdate any object.  After a while I figured out that forgot to make my Mapping class Public.

And it resolve the problem.

My DataModel Class

namespace NHBData.Model

{

public class Employee

{

public virtual int EmployeeID { get; set; }

public virtual string  EmaployeeName { get; set; }

}

}

 

Mapping file before :

namespace NHBData.Model.Mapping

{

class EmployeeMapping :ClassMap

{

EmployeeMapping()

{            Id(x => x.EmployeeID).Unique();

Map(x => x.EmaployeeName);

}

}

}

Mapping File after

namespace NHBData.Model.Mapping

{

Public class EmployeeMapping :ClassMap

{

EmployeeMapping()

{            Id(x => x.EmployeeID).Unique();

Map(x => x.EmaployeeName);

}

}

}


You can have a look to another annoying error and its solution “LazyLoadException” in nhibernate here

 

Hope this helps to someone..

Have a nice time ..

 

 

 

Advertisements

2 thoughts on ““No Persister For” error in Nhibernate

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s