我已经搜索了这个问题..但仍然无法解决它。这是代码。我在
处收到此错误Id(x => x.ID, x => x.Generator(Generators.Identity));
提前谢谢
using NHibernate.Mapping.ByCode;
using NHibernate.Mapping.ByCode.Conformist;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
namespace EventPlanner.Models
{
public class AssetType
{
public virtual int ID { get; set; }
public virtual string Type { get; set; }
public virtual IList<Asset> Assets { get; set; }
}
public class AssetTypeMap : ClassMapping<AssetTypeMap>
{
public AssetTypeMap()
{
Table("AssetType");
Id(x => x.ID, x => x.Generator(Generators.Identity));
Property(x => x.Type, x => x.NotNullable(true));
}
}
}