public async Task <IActionResult> PutTemporaryParcel(int id, TemporaryParcel temporaryParcel) { if (id != temporaryParcel.Id) { return(BadRequest()); } temporaryParcel.Status = true; _context.Entry(temporaryParcel).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TemporaryParcelExists(id)) { return(NotFound()); } else { throw; } } return(Ok()); }
public async Task <ActionResult> PostTemporaryParcel(TemporaryParcel temporaryParcel) { temporaryParcel.Status = true; _context.TemporaryParcel.Add(temporaryParcel); await _context.SaveChangesAsync(); return(StatusCode(201)); }