public static SVC_CreditOperation.FinConditions Translate(SVC_Simulations.FinConditions origin) { SVC_CreditOperation.FinConditions target = null; if (origin != null) { origin.ModifiedFields = null; origin.ModifiedValues = null; origin.TableData = null; origin.Dependencies = null; origin.FieldStates = null; origin.Warnings = null; // save flow reference SVC_Simulations.FinConditionsFlows[] originFlows = origin.Flows; origin.Flows = null; // save rates reference SVC_Simulations.FinConditionsRate[] originRates = origin.Rates; origin.Rates = null; /*get new object, which been mapped*/ SVC_CreditOperation.FinConditions newMapped = origin.CreateMapped <SVC_Simulations.FinConditions, SVC_CreditOperation.FinConditions>(); target = newMapped; target.Status = origin.Status == SVC_Simulations.InstanceStatus.Insert ? SVC_CreditOperation.InstanceStatus.Insert : SVC_CreditOperation.InstanceStatus.Update; target.Flows = DomainTranslator.Translate(originFlows); target.Rates = DomainTranslator.Translate(originRates); } return(target); }
public static SVC_CreditOperation.Entity Translate(SVC_Entities.Entity origin) { SVC_CreditOperation.Entity target = null; if (origin != null) { origin.ModifiedFields = null; origin.ModifiedValues = null; origin.TableData = null; origin.FieldStates = null; origin.Warnings = null; // save EntityAddress reference SVC_Entities.EntityAddress[] originAdresses = origin.Addresses; origin.Addresses = null; // save EntityLegalDoc reference SVC_Entities.EntityLegalDoc[] originLegalDocs = origin.LegalDocs; origin.LegalDocs = null; // save Company reference SVC_Entities.Company origincompany = origin.Company; origin.Company = null; /*get new object, which been mapped*/ SVC_CreditOperation.Entity newMapped = origin.CreateMapped <SVC_Entities.Entity, SVC_CreditOperation.Entity>(); target = newMapped; target.Status = origin.Status == SVC_Entities.InstanceStatus.Insert ? SVC_CreditOperation.InstanceStatus.Insert : SVC_CreditOperation.InstanceStatus.Update; target.Addresses = DomainTranslator.Translate(originAdresses); target.LegalDocs = DomainTranslator.Translate(originLegalDocs); target.Company = DomainTranslator.Translate(origincompany); } return(target); }