开发者

Map List<Int32> using Fluent Nhibernate

I need to map List<Int32> using Fluent Nhibernate.

Sample code:

public class ReportRequest
{
    public List<Int32> EntityIds
    {
        get开发者_Go百科 { return entityIds; }
        set { entityIds = value; }
    }
}

Please guide.

Thank you!


I have implemented it as :

public class ReportRequestMap : ClassMap<ReportRequest>
{
    public ReportRequestMap()
    {
        Id(x => x.Id).UnsavedValue(null).GeneratedBy.Native();        
        HasMany(x => x.EntityIds).Table("ReportEntities").KeyColumn("ReportRequestId").Element("EntityId").AsBag();
    }
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜