Пример #1
0
        public IHttpActionResult PutThrowType(int id, ThrowTypeDto dto)
        {
            if (id != dto.Id)
            {
                return BadRequest();
            }

            _metadataService.Update<ThrowType, ThrowTypeDto>(id, dto);
            return StatusCode(HttpStatusCode.NoContent);
        }
Пример #2
0
 public IHttpActionResult PostThrowType(ThrowTypeDto dto)
 {
     var newDto = _metadataService.Add<ThrowType, ThrowTypeDto>(dto);
     return CreatedAtRoute("DefaultApi", new { controller = "ThrowTypes", id = newDto.Id }, newDto);
 }