Exemple #1
0
        public async Task <IActionResult> Post(FlowRequestModel model)
        {
            var flow = await _flowService.Create(new Flow()
            {
                Title = model.Title
            });

            return(CreatedAtAction(nameof(Get), new { id = flow.Id }, _mapper.Map <FlowResponseModel>(flow)));
        }
Exemple #2
0
        public async Task <IActionResult> Put(Guid id, FlowRequestModel model)
        {
            var flow = await _flowService.Update(new Flow()
            {
                Id    = id,
                Title = model.Title
            });

            if (flow == null)
            {
                return(NotFound());
            }

            return(Ok(_mapper.Map <FlowResponseModel>(flow)));
        }