Note that there are some explanatory texts on larger screens.

plurals
  1. POnhibernate not taking mappings from assembly
    primarykey
    data
    text
    <p>I'm using fnh and castle nhib facility. </p> <p>I followed the advice from mike hadlow here: <a href="http://mikehadlow.blogspot.com/2009/01/integrating-fluent-nhibernate-and.html" rel="nofollow noreferrer">http://mikehadlow.blogspot.com/2009/01/integrating-fluent-nhibernate-and.html</a></p> <p>here is my FluentNHibernateConfigurationBuilder:</p> <pre><code>public Configuration GetConfiguration(IConfiguration facilityConfiguration) { var defaultConfigurationBuilder = new DefaultConfigurationBuilder(); var configuration = defaultConfigurationBuilder.GetConfiguration(facilityConfiguration); configuration.AddMappingsFromAssembly(typeof(User).Assembly); return configuration; } </code></pre> <p>i know the facility is picking it up as i can break inside that method and it steps through.</p> <p>however, when it's done, non of the mappings are created and i get the following error when i try to save an entity:</p> <p>No persister for: IsItGd.Model.Entities.User</p> <p>here is my user class:</p> <pre><code>//simple model of web user public class User { public virtual int Id { get; set; } public virtual string FullName { get; set; } } </code></pre> <p>and here is the mapping:</p> <pre><code> public class UserMap : ClassMap&lt;User&gt; { public UserMap() { Id(x=&gt;x.Id); Map(x=&gt;x.FullName); } } </code></pre> <p>i really can't see what the problem is. the strange thing is - is that if i use automapping it picks everything up - but i don't want to use automapping as i can't do certain things in that scenario.</p> <p>any clues?</p> <p>w://</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload