public async Task <IActionResult> Delete(
            [FromRoute] Guid id
            )
        {
            var commandRequest = new DeleteMaturityLevelCommandRequestModel {
                Id = id
            };

            await this.deleteMaturityLevelCommand.ExecuteAsync(commandRequest);

            return(NoContent());
        }
Example #2
0
        public async Task <Guid> ExecuteAsync(DeleteMaturityLevelCommandRequestModel commandRequest)
        {
            var maturityLevel = await this.maturityLevelsRepository.GetAsync(commandRequest.Id);

            if (maturityLevel == null)
            {
                throw new HttpException(HttpStatusCode.NotFound, $"MaturityLevel (ID: {commandRequest.Id}) cannot be found.");
            }

            await this.maturityLevelsRepository.DeleteAsync(commandRequest.Id);

            return(commandRequest.Id);
        }