I'm trying to use strongly typed json config settings as per the [Options pattern](http://andrewlock.net/how-to-use-the-ioptions-pattern-for-configuration-in-asp-net-core-rc2/) in .net core. All examples so far show how easy it is to inject the strongly typed settings class into a controller but I need to use it in a middleware class (Very similar to [this question](https://stackoverflow.com/questions/32792245/how-to-pass-ioptions-to-an-asp-net-5-middle-ware-service) but I'm no further forward after trying it that way).

So, the setup:

**mysettings.json**

```
{
  "MySettings": {
    "Name": "Some Name from config",
    "Description": "Some Description from config"
  }
}

```

**mysettings.cs**

```
public class MySettings
{
    public string Name { get; set; } = "Default name";

    public string Description { get; set; } = "Default description";
}

```

**startup.cs**

```
public void ConfigureServices(IServiceCollection services)
{
    services.AddMvc();

    // Add functionality to inject IOptions<T>
    services.AddOptions();

    // Add our Config object so it can be injected
    services.Configure<MySettings>(Configuration.GetSection("MySettings"));
    services.AddSingleton<IMySettingsService, MySettingsService>();
}

```

**MysettingsService.cs**

```
public class MysettingsService : IMysettingsService
{
    private MySettings mySettings { get; set; }

    public MysettingsService (MySettings _mySettings)
    {
        mySettings = _mySettings.value;
    }

    public string GetName()
    {
        return mySettings.Name; 
    }
}

```

How do I go about instantiating **MysettingsService.cs** and injecting an `IOptions<MySettings>` into the class constructor so I can call the **GetName** method?