Horje
Options Pattern how to use Code Example
Options Pattern how to use
// AppSettingsController.cs
[Route("appsettings")]
public class AppSettingsController : Controller
{
    ...
    protected readonly IOptions<RoundTheCodeSync> _roundTheCodeSyncOptions;
 
    public AppSettingsController(..., IOptions<RoundTheCodeSync> roundTheCodeSyncOptions)
    {
        ...
        _roundTheCodeSyncOptions = roundTheCodeSyncOptions;
    }
 
    ...
 
    [Route("second-way")]
    public IActionResult SecondWay()
    {
        return Content(_roundTheCodeSyncOptions.Value.Title, "text/plain");
    }
}




Csharp

Related
ternary operator c# Code Example ternary operator c# Code Example
unity debug log gameobject Code Example unity debug log gameobject Code Example
chaine de connexion sql server c# Code Example chaine de connexion sql server c# Code Example
c# sequential struct with fixed array size Code Example c# sequential struct with fixed array size Code Example
how to iterate through a game object in unity Code Example how to iterate through a game object in unity Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
10