help please
My code:
nhConfig = new Configuration();
nhConfig.AddAssembly("NhibTest");
nhFactory = nhConfig.BuildSessionFactory();
ISession session = nhFactory.OpenSession();
ITransaction transaction = session.BeginTransaction();
User newUser = new User();
newUser.Id = "joe_cool";
newUser.UserName = "Joseph Cool";
newUser.Password = "abc123";
newUser.EmailAddress = "
[email protected]";
newUser.LastLogon = DateTime.Now;
// Tell NHibernate that this object should be saved
session.Save(newUser);
// commit all of the changes to the DB and close the ISession
transaction.Commit();
session.Close();
It looks like if Nhibernate don't see the User.hmb.xml..
May be I must link this file?
my User.hmb.xml is:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="NhibTest.User, NhibTest" table="Users">
<id name="Id" column="LogonId" type="String" length="20">
<generator class="assigned" />
</id>
<property name="UserName" column="Name" type="String" length="40"/>
<property name="Password" type="String" length="20"/>
<property name="EmailAddress" type="String" length="40"/>
<property name="LastLogon" type="DateTime"/>
</class>
</hibernate-mapping>