示例#1
0
 public async Task <IActionResult> Create([Bind("Id,CityId,DateUpdated")] LogisticsCenterDTO logisticsCenter)
 {
     if (ModelState.IsValid)
     {
         _dbAccess.AddLogisticsCenter(logisticsCenter);
         _dbAccess.SaveChanges();
         return(RedirectToAction(nameof(Index)));
     }
     ViewData["CityId"] = new SelectList(_dbAccess.GetCities(), "Id", "Name", logisticsCenter.CityId);
     return(View(logisticsCenter));
 }