无法将Lambda表达式转换为字符串类型

时间:2015-12-22 12:59:55

标签: c# nhibernate

我已经搜索了这个问题..但仍然无法解决它。这是代码。我在

处收到此错误
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));
        }
    }
}

0 个答案:

没有答案