예제 #1
0
        public async Task<IHttpActionResult> PutAttribute(int id, ProductAttribute attribute)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            await _manageService.EditEntityAsync(attribute);

            return StatusCode(HttpStatusCode.NoContent);
        }
예제 #2
0
        public async Task<IHttpActionResult> PostAttribute(ProductAttribute attribute)
        {
            await _manageService.AddEntityAsync(attribute);

            return CreatedAtRoute("Attribute", new { id = attribute.Id }, attribute);
        }