public void Put(int id, [FromBody] JObject value) { Dealership dealership = value.ToObject <Dealership>(); dealership.ID = id; DealershipMgr.Put(dealership); }
public async Task <IActionResult> Edit(int id, [Bind("ID,Name,Email,Phone")] Dealership dealership)// Posibly change if fails { if (id != dealership.ID) { return(NotFound()); } if (ModelState.IsValid) { try { DealershipMgr.Put(dealership); } catch (DbUpdateConcurrencyException) { if (!DealershipExists(dealership.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dealership)); }
public IActionResult Edit(int id, [Bind("ID,Name,Email,PhoneNumber")] Dealership dealership) { if (id != dealership.ID) { return(NotFound()); } if (ModelState.IsValid) { try { _contextDmgr.Put(id, dealership); } catch (DbUpdateConcurrencyException) { if (!DealershipExists(dealership.ID)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dealership)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Name,Email,PhoneNumber")] Dealership dealership) { if (id != dealership.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _dealershipMgr.Put(id, dealership); } catch (Exception) { if (!DealershipExists(dealership.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(dealership)); }
public String PutDealership([FromRoute] int id, [FromBody] Dealership dealership) { // dealershipMgr.Put(dealership,id); //_context.Entry(dealership).State = EntityState.Modified; dealershipMgr.Put(dealership, id); return("Dealership has been updated"); }
public IActionResult Put(int id, [FromBody] Dealership dealership) { _contextDmgr.Put(id, dealership); return(Ok()); }
public void Put(int id, [FromBody] string dealership) { _dealershipMgr.Put(id, JsonConvert.DeserializeObject <Dealership>(dealership)); }