Пример #1
0
        public async Task <IActionResult> Create([FromBody] MalfunctionDTO obj)
        {
            var createdEntity = await _malfunctionService.CreateAsync(obj);

            return(createdEntity != null
                ? CreatedAtAction(nameof(Create), createdEntity)
                : (IActionResult)BadRequest());
        }
Пример #2
0
 public async Task <IActionResult> Create([FromBody] MalfunctionDTO obj)
 {
     return(CreatedAtAction(nameof(Create), await _malfunctionService.CreateAsync(obj)));
 }