Fluent Nhibernate Error No Persister For
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of no persister for nhibernate c# this site About Us Learn more about Stack Overflow the company Business Learn
Fluent Nhibernate No Persister For Entity
more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question no persister for nhibernate mapping by code x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Fluent NHibernate mapping exception (no persister error) up vote 0 down vote favorite I have the following code which gives me a mapping exception with no persister error: var sessionFactory = Fluently.Configure() .Database( OracleClientConfiguration.Oracle10.ConnectionString( c => c.FromConnectionStringWithKey("Main.ConnectionString"))) .Mappings(x => x.FluentMappings.AddFromAssembly(Assembly.GetExecutingAssembly())) .BuildSessionFactory(); using (var session = sessionFactory.OpenSession()) { using (var tx = session.BeginTransaction()) { var card = new Card {CardType = "Test"}; session.Save(card); tx.Commit(); } } I have three projects in my solution: MainApplication , Entities and EntityMappings MainApp has a reference to Entities and EntityMappings has a reference to Entities I don't understand what I am doing wrong. Any ideas ? EDIT: The properties are public The exact error message is : No persister for: TNT_DAL.EntityClasses.Card c# fluent-nhibernate share|improve this question edited May 5 '14 at 9:09 asked May 5 '14 at 8:31 Cemre 4,20595297 Can you provide the full exception message please? If I recall correctly it should mention no persister for a particular class or database field. –JW Lim May 5 '14 at 9:03 @JWLim yes you are right. please see the edit –Cemre May 5 '14 at 9:09 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote accepted Make sure that your entity and mapping classes are public. Properties for your entities i.e. database fields should be public virtual. Also try specifying the assembly of a mapping class instead of using GetExecutingAssembly(), I do vaguely recall experiencing trouble with it when I tried setting up FNH for the fir
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with http://stackoverflow.com/questions/23468116/fluent-nhibernate-mapping-exception-no-persister-error us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up NHibernate.MappingException: http://stackoverflow.com/questions/57804/nhibernate-mappingexception-no-persister-for-xyz No persister for: XYZ up vote 114 down vote favorite 12 Now, before you say it: I did Google and my hbm.xml file is an Embedded Resource. Here is the code I am calling: ISession session = GetCurrentSession(); var returnObject = session.Get
ASP.NET Community Standup Forums Help Home/ASP.NET Forums/Data Access/ADO.NET, Entity Framework, LINQ to SQL, NHibernate/nHiberanate 3.0 + Fluent nHiberanate : "No Persister for:" Error nHiberanate 3.0 + Fluent nHiberanate http://forums.asp.net/t/1787017.aspx?nHiberanate+3+0+Fluent+nHiberanate+No+Persister+for+Error : "No Persister for:" Error [Answered]RSS 2 replies Last post Mar 30, 2012 12:15 PM by krokonoster ‹ Previous Thread|Next Thread › Print Share Twitter Facebook Email Shortcuts Active Threads Unanswered Threads Unresolved Threads Support Options Advanced Search Reply krokonoster Contributor 3572 Points 1675 Posts nHiberanate 3.0 + Fluent nHiberanate : "No Persister for:" Error Mar 29, 2012 06:01 PM|krokonoster|LINK Hi, Made my no persister first attempt at nHibernate after I got a sample working (which was a bit simpler and all inside a single console app) However, I'm stuck with some "No persister for: [myclass]" error and no question / answer I found could solve my problem so far. I uploaded the source code to github for in case someone want to see the complete code. In no persister for a nutshell it's 3 projects. One "infrastructure" (domain entities and service interfaces), nl. krok.blog and a nHibernate implementation of those services in krok.blog.data. I "use" this in a sandbox console app (in the test folder). The domain are very simple (maybe not for a n00b with nHibernate) but let me post some code: namespace krok.blog.Domain { public class Post : Entity