// POST api/v1/items public async Task <IHttpActionResult> PostAsync([FromBody] Item item) { ValidatePostedItem(item); if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var newItem = await _itemsService.AddItemAsync(item); var location = _itemLocationHelper.CreateLocation(newItem.Id); return(Created(location, newItem)); }
public async Task AddItem(T t) { await _itemsService.AddItemAsync(t); }