The exception is:
Could not compile the mapping document: WindowsFormsApplication2.Products.hbm.xml
and the inner exception is:
Persistent class Sample.CustomerService.Domain.Products, Sample.CustomerService. Domain not found
my configuration is:
And class for mapping is
namespace Sample.CustomerService.Domain
{
public class Product
{
public virtual int Productid { get; set; }
public virtual string Name { get; set; }
}
}
and session factory is
public sealed class SessionFactory
{
private static volatile ISessionFactory iSessionFactory;
private static object syncRoot = new object();
public static ISession OpenSession
{
get
{
if (iSessionFactory == null)
{
lock (syncRoot)
{
if (iSessionFactory == null)
{
Configuration configuration = new Configuration();
configuration.AddAssembly(Assembly.GetCallingAssembly());
iSessionFactory = configuration.BuildSessionFactory();
}
}
}
return iSessionFactory.OpenSession();
}
}
}
when i try to get record by this code
using (ISession session = SessionFactory.OpenSession)
{
IQuery query = session.CreateQuery("FROM Products");
IList<Products> pInfos = query.List<Products>();
dgView.DataSource = pInfos;
}
it gives me error could not compile mapping document as explained above. i am new to hibernate, i added hibernte from nugget.org by manage nugget pcakage option in visual studio 2012, it added two dlls nhhibernate and Iesi.collections. please help me fix this error, i gave all info in my knowledge.