ASP.NET Monsters #6: JSON Data and The Options Pattern

Sign in to queue

Description

So, the problem with configuration is that in the past it's not really been that great to work with. In ASP.NET there are wholesale changes and, in our last video, we looked at how the runtime gives better options for storage and mechanisms for loading data. Here, we'll look at structured storage and strongly-typed config.

One you have your data loaded wouldn't it be grand if you could access it through typical objects? The new options pattern in Core MVC gives us the ability; mapping structured configuration into proper objects that we can inject into our classes and use at runtime.

Be sure to follow the Monsters on Twitter and check out the blog for related posts.

The production code for this video is N0.

Embed

Download

The Discussion

  • User profile image
    Accent

    What is the deal with fake accent? Mega annoying.

  • User profile image
    Accent Critic

    I know right?! Like seriously, James should really stop sounding like that.

    But seriously, Simon comes from New Londonstan in Alberta, Canada, which was a British settlement after the first world war. If you go there, everyone has an accent like that - somewhere between Essex and Rural Alberta Redneck; its like they want to invite you over for tea and a Duck Dynasty marathon.

    Its the only place in Canada where you can legally drive on the left side of the road and there's a bylaw that you must own both a gun and a picture of the Queen in your home.

    For reals, look it up!

  • User profile image
    Andriy

    Nice videos about MVC6. Can you show a right way to create Bearer token for Authentication using Individual User Account, like in MVC 5 using OWIN.
    Thanks

  • User profile image
    Canadian​James

    @Andriy:Hi there, yes, we'll be doing a few episodes on identity and we'll be looking at tokens and external services. Cheers!

  • User profile image
    darivuki

    If I change the .json config file at runtime and save it, the MonsterSetting class won't dynamically know about this change and map the new change to it's property, am I right?

Add Your 2 Cents