Domanda

Devo mappare Elenco < Int32 > utilizzando Fluor Nhibernate.

Codice di esempio:

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

Per favore guida.

Grazie!

È stato utile?

Soluzione

L'ho implementato come:

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();
    }
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top