Esempio n. 1
0
        public IHttpActionResult PutThrow(int id, ThrowDto dto)
        {
            if (id != dto.Id)
            {
                return BadRequest();
            }

            _metadataService.Update<Throw, ThrowDto>(id, dto);

            return StatusCode(HttpStatusCode.NoContent);
        }
Esempio n. 2
0
        public IHttpActionResult PostThrow(ThrowDto dto)
        {
            var newDto = _metadataService.Add<Throw, ThrowDto>(dto);

            return CreatedAtRoute("DefaultApi", new { controller = "Throws", id = newDto.Id }, newDto);
        }
Esempio n. 3
0
        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;
        }