コード例 #1
0
        public async Task <CustAccountsVM> GetAccs(int id)
        {
            var customer = await _context.Customer.FirstOrDefaultAsync(m => m.Id == id);

            var custAccounts = new CustAccountsVM();


            var orders = await _context.Accounts
                         //.Where(o => o.Id == id)
                         .ToListAsync <Account>();

            custAccounts.CustAccounts = orders;


            return(custAccounts);
        }
コード例 #2
0
        // GET: Account/Details/id
        public async Task <IActionResult> Actions(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var custAccounts = new CustAccountsVM();


            var account = await _repo.Get(id);

            var accounts = await _repo.Get(User.Identity.Name);

            custAccounts.ActiveAccount = account;
            custAccounts.CustAccounts  = accounts;

            return(View(custAccounts));
        }