public static MonthDetail Load(dynamic dyn) { Func <dynamic, MonthDetail> func = (d) => { var month = new MonthDetail { Activity = d.activity, AgeOfMoney = d.age_of_money, Budgeted = d.budgeted, Income = d.income, Month = d.month, Note = d.note, ToBeBudgeted = d.to_be_budgeted, }; foreach (var mc in d.categories) { month.Categories.Add(Category.Load(mc)); } return(month); }; return(YnabApi.ProcessApiResult(dyn, func)); }
public static MonthDetailWrapper Load(dynamic dyn) { Func <dynamic, MonthDetailWrapper> func = (d) => { return(new MonthDetailWrapper { Month = MonthDetail.Load(d.month) }); }; return(YnabApi.ProcessApiResult(dyn, func)); }
public static BudgetDetail Load(dynamic dyn) { Func <dynamic, BudgetDetail> func = (d) => { var result = new BudgetDetail { BudgetId = d.id, CurrencyFormat = CurrencyFormat.Load(d.currency_format), DateFormat = DateFormat.Load(d.date_format), FirstMonth = d.first_month, LastModifiedOn = d.last_modified_on, LastMonth = d.last_month, Name = d.name, }; foreach (var a in d.accounts) { result.Accounts.Add(Account.Load(a)); } foreach (var p in d.payees) { result.Payees.Add(Payee.Load(p)); } foreach (var l in d.payee_locations) { result.PayeeLocations.Add(PayeeLocation.Load(l)); } foreach (var g in d.category_groups) { result.CategoryGroups.Add(CategoryGroup.Load(g)); } foreach (var c in d.categories) { result.Categories.Add(Category.Load(c)); } foreach (var m in d.months) { result.Months.Add(MonthDetail.Load(m)); } foreach (var t in d.transactions) { result.Transactions.Add(TransactionSummary.Load(t)); } foreach (var s in d.subtransactions) { result.SubTransactions.Add(SubTransaction.Load(s)); } foreach (var s in d.scheduled_transactions) { result.ScheduledTransactions.Add(ScheduledTransactionSummary.Load(s)); } foreach (var s in d.scheduled_subtransactions) { result.ScheduledSubTransactions.Add(ScheduledSubTransaction.Load(s)); } return(result); }; return(YnabApi.ProcessApiResult(dyn, func)); }