public async Task <IActionResult> PutTodoItem(int id, BatteryItems batteryItems) { if (id != batteryItems.id) { return(BadRequest()); } _context.Entry(batteryItems).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!BatteryExists(id)) { return(NotFound()); } else { throw; } } return(Ok(batteryItems)); // You can create or update data through postman with this put method. }
protected override void AddToList() { if (ItemType == ItemTypes.Battery) { BatteryItems.Add(this); } else { PowerCellItems.Add(this); } }
protected override void AddToList() { BatteryItems.Add(this); }