我在执行
ISessionFactory factory = null;
Configuration cfg = null;
cfg = new Configuration();
cfg.AddAssembly("business");
factory = cfg.BuildSessionFactory();
时
cfg.AddAssembly("business");报错。
报错内容是:could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate
映射文件内容为
using System;
using Nullables;
namespace business.Entity
{
/// <summary>
/// Person 的摘要说明。
/// </summary>
public class Person
{ int _id;
string _name;
Nullables.NullableDateTime _dateOfBirth;
public Person()
{
}
public int Id
{
get { return this._id; }
}
public string Name
{
get { return this._name; }
set { this._name = value; }
}
public Nullables.NullableDateTime DateOfBirth
{
get { return this._dateOfBirth; }
set { this._dateOfBirth = value; }
} }
}<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="business.Entity.Person, business" table="Person">
<id name="Id" access="field.camelcase-underscore" unsaved-value="0">
<generator class="native" />
</id>
<property name="Name" type="String" length="200" />
<property name="DateOfBirth" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" column="DateOfBirth"/>
</class>
</hibernate-mapping>我已经加载了Nullables.dll 和 Nullables.NHibernate请各位高手看看怎么回事
ISessionFactory factory = null;
Configuration cfg = null;
cfg = new Configuration();
cfg.AddAssembly("business");
factory = cfg.BuildSessionFactory();
时
cfg.AddAssembly("business");报错。
报错内容是:could not interpret type: Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate
映射文件内容为
using System;
using Nullables;
namespace business.Entity
{
/// <summary>
/// Person 的摘要说明。
/// </summary>
public class Person
{ int _id;
string _name;
Nullables.NullableDateTime _dateOfBirth;
public Person()
{
}
public int Id
{
get { return this._id; }
}
public string Name
{
get { return this._name; }
set { this._name = value; }
}
public Nullables.NullableDateTime DateOfBirth
{
get { return this._dateOfBirth; }
set { this._dateOfBirth = value; }
} }
}<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
<class name="business.Entity.Person, business" table="Person">
<id name="Id" access="field.camelcase-underscore" unsaved-value="0">
<generator class="native" />
</id>
<property name="Name" type="String" length="200" />
<property name="DateOfBirth" type="Nullables.NHibernate.NullableDateTimeType, Nullables.NHibernate" column="DateOfBirth"/>
</class>
</hibernate-mapping>我已经加载了Nullables.dll 和 Nullables.NHibernate请各位高手看看怎么回事
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货