示例#1
0
        public IActionResult CustomerPage()
        {
            string name         = User.Identity.Name;
            var    CarAndCustVM = new CarCustomerViewModel()
            {
                Cars            = _sparkDbContext.Cars.Where(c => c.ApplicationUserId == name).ToList(),
                applicationUser = _applicationDbcontext.ApplicationUsers.FirstOrDefault(u => u.UserName == name)
            };

            return(View(CarAndCustVM));
        }
示例#2
0
        public IActionResult GetCustomerById(string id)
        {
            ViewBag.Id = id;

            var CarAndCustVM = new CarCustomerViewModel()
            {
                Cars            = _sparkDbContext.Cars.Where(c => c.ApplicationUserId == id).ToList(),
                applicationUser = _applicationDbContext.ApplicationUsers.FirstOrDefault(u => u.Email == id)
            };


            return(View(CarAndCustVM));
        }