public static TarifTv MapTarifTv(XpoTarifTv TarifTv) { var TarifTvinstance = new TarifTv() { id = TarifTv.Oid, Mois = TarifTv.Mois, annee = TarifTv.Annee, autre = TarifTv.Autre, nom = TarifTv.Nom }; TarifTvinstance.supportTvs = new List<SupportTV>(); foreach (var sup in TarifTv.SupportTvs) { TarifTvinstance.supportTvs.Add(MapSupportTv(sup)); } TarifTvinstance.LignesTarifTvs = new List<LignesTarifTv>(); foreach (var lig in TarifTv.LigneTarifTvs) { TarifTvinstance.LignesTarifTvs.Add(MapLigneTarifTv(lig)); } return TarifTvinstance; }
public static object MapTarifTv(TarifTv entity, UnitOfWork uow) { var tarifTv = new XpoTarifTv(uow) { Nom = entity.nom, Annee = entity.annee, Autre = entity.autre, Mois = entity.Mois, Oid = entity.id, }; foreach (var Sup in entity.supportTvs) { var supTemp = uow.GetObjectByKey<XpoSupportTV>(entity.id); if (supTemp != null) tarifTv.SupportTvs.Add(supTemp); } foreach (var lig in entity.LignesTarifTvs) { var templig = MapLigneTarifRadio(lig, uow); if (templig != null) tarifTv.LigneTarifTvs.Add(templig); } return tarifTv; }