public CustomerInfoViewModel GetCustomer(int id) { if (_context.Customers.Where(c => c.CustomerId == id).Count() == 0) { CustomerInfoViewModel model = new CustomerInfoViewModel(); model.SetVisible(false); return(model); } else { CustomerInfoViewModel model = new CustomerInfoViewModel(); model.SetCustomer(new GetCustomer(_context).ByCustomerId(id)); // InfoQuery model.SetAccounts(new GetAccounts(_context).OfCustomer(model.Customer)); return(model); } }