Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

.net 6 get appsettings value

1
2
3
4
5
6
7
8
9
10
11
12
// AppSettingsController.cs
[Route("appsettings")]
public class AppSettingsController : Controller
{
    ...
 
    [Route("first-way")]
    public IActionResult FirstWay()
    {
        return Content(_configuration.GetValue<string>("RoundTheCodeSync:Title"), "text/plain");
    }
}
Source by www.roundthecode.com #
 
PREVIOUS NEXT
Tagged: #appsettings
ADD COMMENT
Topic
Name
8+9 =