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();
}
}
精彩评论