public static TarifRd MapTarifRd(XpoTarifRd TarifRd) { var TarifRdinstance = new TarifRd() { id = TarifRd.Oid, Mois = TarifRd.Mois, annee = TarifRd.Annee, autre = TarifRd.Autre, nom = TarifRd.Nom }; TarifRdinstance.supportRds = new List<SupportRadio>(); foreach (var sup in TarifRd.SupportRadios) { TarifRdinstance.supportRds.Add(MapSupportRadio(sup)); } TarifRdinstance.LignesTarifRds = new List<LignesTarifRd>(); foreach (var lig in TarifRd.LigneTarifRds) { TarifRdinstance.LignesTarifRds.Add(MapLigneTarifRd(lig)); } return TarifRdinstance; }
public static object MapTarifRd(TarifRd entity, UnitOfWork uow) { var tarifRd = new XpoTarifRd(uow) { Nom = entity.nom, Annee = entity.annee, Autre = entity.autre, Mois = entity.Mois, Oid = entity.id, }; foreach (var Sup in entity.supportRds) { var supTemp = uow.GetObjectByKey<XpoSupportRadio>(entity.id); if (supTemp != null) tarifRd.SupportRadios.Add(supTemp); } foreach (var lig in entity.LignesTarifRds) { var templig = MapLigneTarifRadio(lig, uow); if (templig != null) tarifRd.LigneTarifRds.Add(templig); } return tarifRd; }