public PaymentRequisites TraverseTemplate(PaymentTemplate template) { PaymentRequisites requisite = new PaymentRequisites(); requisite.ID = template.ID; requisite.AccountId = template.Account.ID; requisite.Amount = template.Amount; requisite.JsonPayment = template.JsonPayment; requisite.Type = template.EripType; return requisite; }
public PaymentTemplate TraverseTemplate(PaymentRequisites requisites) { PaymentTemplate template = new PaymentTemplate(); Account account = db.Accounts.Find(requisites.AccountId); if (account == null) { throw new WebFaultException(HttpStatusCode.NotFound); } template.Account = account; template.Amount = requisites.Amount; template.JsonPayment = requisites.JsonPayment; template.EripType = requisites.Type; return template; }