Exemplo n.º 1
0
        public IActionResult Put(int id, [FromBody] FlowModel updatedFlow)
        {
            var flow = _flowService.Update(updatedFlow.ToDomainModel());

            if (flow == null)
            {
                return(NotFound());
            }
            return(Ok(flow.ToApiModel()));
        }
Exemplo n.º 2
0
 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));
 }