Custom configuration class for use with IServiceCollection Configure RRS feed

  • Question

  • User310927902 posted

    I have some static classes I pass in, my controller ctor's match the signature of the type I can access those properties easily enough within the controllers.

    However I now have some custom types that require deserialization from XML configuration files. These do not follow any web.config syntax etc.

    How does one use the frameworks dependency injection to push an exiting instance of a type into the controllers from the startup.cs file?


    Thursday, December 17, 2015 12:21 AM


  • User310927902 posted

    Turns out the new ASP.NET 5 strongly typed configuration backed by json can deserialize much the same as XML and automatically cast entities.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, December 17, 2015 10:46 PM