示例#1
0
        public void RemoveDealership(DealershipDetailsViewModel entity)
        {
            Dealership dealership = context.Dealerships.Find(entity.DealershipId);

            context.Dealerships.Remove(dealership);
            context.SaveChanges();
        }
示例#2
0
        public IActionResult Delete(int id)
        {
            Dealership dealership            = service.GetOneDealership(id);
            DealershipDetailsViewModel model = new DealershipDetailsViewModel
            {
                DealershipId = dealership.DealershipId,
                Name         = dealership.Name,
                Country      = dealership.Country,
                Town         = dealership.Town,
                Cars         = dealership.Cars
            };

            return(View(model));
        }
示例#3
0
 public IActionResult Delete(DealershipDetailsViewModel entity)
 {
     service.RemoveDealership(entity);
     return(Redirect("/"));
 }