WebApplication1/Controllers/TodoController.cs
/// <summary>
/// Get all TodoItems associated to an individual API key
/// </summary>
/// <param name="apiKey">The API key that hosts all of the TodoItems</param>
/// <returns>An array of TodoItems containing the task and id</returns>
/// <response code="200">The TodoItems were found and returned</response>
/// <response code="400">The request was invalid</response>
Get all TodoItems associated to an individual API key
Get all TodoItems associated to an individual API key
[HttpGet]
        [ProducesResponseType(typeof(List<TodoItem>), (int)HttpStatusCode.OK)]
        [ProducesResponseType(typeof(void), (int)HttpStatusCode.BadRequest)]
        public IActionResult Get([FromQuery] string apiKey)
        {
            if (string.IsNullOrWhiteSpace(apiKey)) return BadRequest();
            return Ok(GetTodoItem(apiKey));
        }
[ HttpGet ] [ ProducesResponseType ( typeof ( List < TodoItem > ) , ( int ) HttpStatusCode . OK ) ] [ ProducesResponseType ( typeof ( void ) , ( int ) HttpStatusCode . BadRequest ) ] public IActionResult Get ( [ FromQuery ] string apiKey ) { if ( string . IsNullOrWhiteSpace ( apiKey ) ) return BadRequest ( ) ; return Ok ( GetTodoItem ( apiKey ) ) ; }
Get all TodoItems associated to an individual API key
Get all TodoItems associated to an individual API key
// Validation
An array of TodoItems containing the task and id
An array of TodoItems containing the task and id
string
[FromQuery]
apiKey
The API key that hosts all of the TodoItems
The API key that hosts all of the TodoItems
response
The TodoItems were found and returned
The TodoItems were found and returned
response
The request was invalid
The request was invalid