Skip to content

Instantly share code, notes, and snippets.

@awswithdotnet
Last active May 23, 2022 16:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awswithdotnet/7a069f54db3aaffbef19727c3754bee6 to your computer and use it in GitHub Desktop.
Save awswithdotnet/7a069f54db3aaffbef19727c3754bee6 to your computer and use it in GitHub Desktop.
ssms-ps Api ParameterController Complete
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