private SmashAttributeTypeDto Post(SmashAttributeTypeDto smashAttributeType)
 {
     return ExecuteAndReturnCreatedAtRouteContent<SmashAttributeTypeDto>(
         () => _controller.PostSmashAttributeType(smashAttributeType));
 }
 public IHttpActionResult PostSmashAttributeType(SmashAttributeTypeDto dto)
 {
     var newDto = _smashAttributeTypesService.Add<SmashAttributeType, SmashAttributeTypeDto>(dto);
     return CreatedAtRoute("DefaultApi", new { controller = "SmashAttributeTypes", id = newDto.Id }, newDto);
 }
        public IHttpActionResult PutSmashAttributeType(int id, SmashAttributeTypeDto dto)
        {
            if (id != dto.Id)
            {
                return BadRequest();
            }

            _smashAttributeTypesService.Update<SmashAttributeType, SmashAttributeTypeDto>(id, dto);
            return StatusCode(HttpStatusCode.NoContent);
        }
Esempio n. 4
0
        public SmashAttributeTypeDto SmashAttributeType()
        {
            var smashAttributeType = new SmashAttributeTypeDto
            {
                Id = _smashAttributeTypeCounter,
                Name = "max fall speed",
            };

            _smashAttributeTypeCounter++;

            return smashAttributeType;
        }