public async Task <IActionResult> CreateSignal(SlackMessage message)
        {
            int result = _repository.CreateSignal(message);

            if (result == 0)
            {
                return(BadRequest());
            }

            return(Accepted());
        }
Exemplo n.º 2
0
        public async Task <IActionResult> CreateSignal(SlackMessage message)
        {
            var result = _repository.CreateSignal(message);

            switch (result)
            {
            case 400:
                // Student with this ID doesn't exist
                return(BadRequest());

            case 409:
                // Student with this ID already has a record
                return(StatusCode(409));

            case 200:
                return(Accepted());

            default: StatusCode(result);
                break;
            }

            return(null);
        }