public ActionResult <LaunchDto> Add(Launch launch)
        {
            var result = _launchService.Add(launch);

            return(result.IsSuccess ? Ok(new LaunchDto(result.Value))
                : (ActionResult)NotFound());
        }
Esempio n. 2
0
 public IActionResult Add([FromBody] LaunchViewModelInput launchViewModelInput)
 {
     try
     {
         _launchService.Add(launchViewModelInput);
         return(NoContent());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex));
     }
 }