public async Task<IHttpActionResult> PutAttribute(int id, ProductAttribute attribute) { if (!ModelState.IsValid) { return BadRequest(ModelState); } await _manageService.EditEntityAsync(attribute); return StatusCode(HttpStatusCode.NoContent); }
public async Task<IHttpActionResult> PostAttribute(ProductAttribute attribute) { await _manageService.AddEntityAsync(attribute); return CreatedAtRoute("Attribute", new { id = attribute.Id }, attribute); }