Fluent NHibernate auto mapping

Asked By jithendra
27-Jul-10 02:52 PM
Earn up to 0 extra points for answering this tough question.
Hi,

I have two questions about fluent Nhibernate auto mapping

1. No persister for:


i am getting the above error when i try to save my data using the following

AutoMappingNHibernate.Author author = new AutoMappingNHibernate.Author();
      author.AuthorInfo = ".Net developer extraordinaire";
      author.AuthorFirstName = "Peter";
      author.AuthorLastName = "Bromberg";
      author.AuthorName = "Peter Bromberg";
      ITransaction trans = session.BeginTransaction();
session.Save(author);

2. Where(t => t.Namespace.StartsWith("QuotesApp"))

what exactly we are doing here and what value we need to pass inside startswith?

Please suggest me, how to solve 1 problem and what value i need to pass on second

It's very urgent, please help me

Thanking  you

My email id is : jith_n@yahoo.com

With Regards,
Jithendra

  re: Fluent NHibernate auto mapping

Peter Bromberg replied to jithendra
27-Jul-10 03:13 PM
Did you set the  Build Action of any of your .hbm.xml  files to Embedded Resource?

Regarding Where(t => t.Namespace.StartsWith("QuotesApp")) you are simply saying do the mapping only on classes where the namespace starts with "QuotesApp" (or whatever your namespace for your classes is).

  re: Fluent NHibernate auto mapping

jithendra replied to Peter Bromberg
27-Jul-10 03:24 PM
Hi Peter Bromberg,

Thank  you very much for your prompt reply

i do not have .hbm.xml files, it's automapping using fluent Nhibernate, i just followed your article using the following link

http://www.eggheadcafe.com/tutorials/aspnet/50aa9259-6dbb-4d16-9639-81ee42171b00/more-fun-with-fluent-nhibernate-automapping.aspx

In the above article you asked me to create class files and program.cs file, i just exactly what you did on the above article.

Please suggest me what i need to do to fix that "No Persister" problem

Thanking you

With Regards,
Jithendra
Create New Account