Beispiel #1
0
        public async Task <ActionResult <TalkModel> > Post(string moniker, TalkModel model)
        {
            var res = await _talkService.CreateTalk(moniker, model);

            switch (res.statusCode)
            {
            case 400:
                return(BadRequest(res.message));

            case 500:
                return(StatusCode(StatusCodes.Status500InternalServerError, res.message));

            default:
            {
                var url = _linkGenerator.GetPathByAction(HttpContext, "Get", values: new { moniker, id = res.talkModel.TalkId });
                return(Created(url, res.talkModel));
            }
            }
        }