Skip to content

Instantly share code, notes, and snippets.

@MahdiKarimipour
Last active July 25, 2023 09:31
Show Gist options
  • Save MahdiKarimipour/c0ef99687f966d964d2c79455005dbdd to your computer and use it in GitHub Desktop.
Save MahdiKarimipour/c0ef99687f966d964d2c79455005dbdd to your computer and use it in GitHub Desktop.
Pellerex Secret Usage
[ApiController]
[ApiVersion("1.0")]
public class AiController : ControllerBase
{
private readonly AppSecrets appSecrets;
public AiController(ISampleAIService sampleAIService, IConfiguration configuration)
{
this.appSecrets = configuration.Get<AppSecrets>();
}
[HttpGet("hello")]
[MapToApiVersion("1.0")]
public async Task<ActionResult<AIResponseViewModel>> Process()
{
return Ok(new ViewModel
{
DbConnectionString = appSecrets.DbConnectionString
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment