コード例 #1
0
        public async Task<IHttpActionResult> PutProductType(int id, ProductType attribute)
        {
            if (!ModelState.IsValid)
            {
                return BadRequest(ModelState);
            }

            await _manageService.EditEntityAsync(attribute);

            return StatusCode(HttpStatusCode.NoContent);
        }
コード例 #2
0
        public async Task<IHttpActionResult> PostProductType(ProductType attribute)
        {
            await _manageService.AddEntityAsync(attribute);

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