سؤال

ولست بحاجة لتعيين قائمة باستخدام يجيد Nhibernate.

ونموذج التعليمات البرمجية:

public class ReportRequest
{
    public List<Int32> EntityIds
    {
        get { return entityIds; }
        set { entityIds = value; }
    }
}

يرجى توجيه.

وشكرا لك!

هل كانت مفيدة؟

المحلول

ولقد نفذت على النحو التالي:

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();
    }
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top