public IActionResult Post([FromBody] FlowModel flow) { try { _flowService.Add(flow.ToDomainModel()); } catch (System.Exception ex) { ModelState.AddModelError("AddFlow", ex.GetBaseException().Message); return(BadRequest(ModelState)); } return(CreatedAtAction("Get", new { Id = flow.Id }, flow)); }
public IActionResult Post([FromBody] FlowModel flow) { var addedFlow = _service.Add(new Business.Service.DTOs.Flow.FlowDto { Title = flow.Title }); if (addedFlow == null) { return(UnprocessableEntity()); } return(Created(new Uri($"{Request.Scheme}://{Request.Host}{Request.Path}/{addedFlow.Id}"), addedFlow)); }