ssms-ps Api ParameterController Complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Microsoft.AspNetCore.Mvc; | |
namespace Api.Controllers; | |
[ApiController] | |
[Route("[controller]")] | |
public class ParameterController : ControllerBase | |
{ | |
private IConfiguration _configuration; | |
public ParameterController(IConfiguration configuration) | |
{ | |
_configuration = configuration; | |
} | |
[HttpGet] | |
public IActionResult GetParameter() | |
{ | |
string parameter1 = _configuration["test-key"]; | |
string parameter2 = _configuration["test-key2"]; | |
string parameter3 = _configuration["test-key3"]; | |
return Ok(new List<string> { parameter1, parameter2, parameter3 }); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment