public IHttpActionResult PutThrow(int id, ThrowDto dto) { if (id != dto.Id) { return BadRequest(); } _metadataService.Update<Throw, ThrowDto>(id, dto); return StatusCode(HttpStatusCode.NoContent); }
public IHttpActionResult PostThrow(ThrowDto dto) { var newDto = _metadataService.Add<Throw, ThrowDto>(dto); return CreatedAtRoute("DefaultApi", new { controller = "Throws", id = newDto.Id }, newDto); }
public ThrowDto Throw() { var move = Move(); var throwType = ThrowType(); var newThrow = new ThrowDto { Id = ++_throwCounter, MoveId = move.Id, ThrowTypeId = throwType.Id, WeightDependent = true, }; return newThrow; }