ASP.NET Monsters (Audio) - Channel 9: Recent Episodes

Microsoft

The ASP.NET Monsters is a group of ASP.NET MVPs who make their living building web applications. Though one of them hails from a beach and another one sports a fake Brittish accent, these gents all currently call Canada home. When they're not blogging you can find Simon, Dave and James speaking at user groups, conferences and workshops across North America, as well as on Microsoft Virtual Academy and here on Channel 9. Looking for the most recent videos? View them here. Check out the Monster Blog. Follow @aspnetmonsters Subscribe to this Series

View Details

ASP.NET Core has a powerful mechanism for implementing resource-based authorization using the IAuthorizationService and resource-based AuthorizationHandlers. In this week's video, Monster Dave builds a tag helper that makes it simple to use resource-based authorization to Razor views without writing any C# code in the view.

Related Links:

Blog Post - https://www.davepaquette.com/archive/2017/11/28/authorize-resource-tag-helper.aspx
Official ASP.NET Core Docs - https://docs.microsoft.com/en-us/aspnet/core/security/authorization/resourcebased?tabs=aspnetcore2x 
NuGet Package: https://www.nuget.org/packages/TagHelperSamples.Authorization/

Follow @aspnetmonsters

View Details

The AllReady project has grown over the years and in order to keep it fresh, we'd like to try moving from Knockout to React for our client-side components. In this episode, Simon takes us through replacing a small Knockout component with an equivalent React component

Follow @aspnetmonsters

View Details

In this episode, Monster Dave builds a new tag helper that makes it easy to control access to any block HTML in a Razor view. Join us for a tour of the Authorize tag helper

Related Links:Tag Helper Samples Reop - https://github.com/dpaquette/TagHelperSamplesGitHub Issue for MVC Core  - https://github.com/aspnet/Mvc/issues/3785Blog Post Deep Dive - https://www.davepaquette.com/archive/2017/11/05/authorize-tag-helper.aspx

Follow @aspnetmonsters

View Details

The new live unit testing capabilities of Visual Studio 2017 are a real timesaver. In this video, we take a poke around at them.

View Details

Entity Framework Core 2 was released recently. In today's episode we explore a new feature called DbContext Pooling. See how enabling DbContext Pooling might magically make your ASP.NET Core application faster!

Related Links:GitHub Repo - https://github.com/AspNetMonsters/EP109-EFDbContextPoolingNetling Load Testing Tool - https://github.com/hallatore/Netling.NET Conf Video - What's new in EF Core 2.0 - https://channel9.msdn.com/Events/dotnetConf/2017/T221

(Section on DbContext Pooling starts at 10:55s)

Follow @aspnetmonsters

View Details

Entity Framework Core 2 was released recently. In today's episode we explore a new feature that allows us to specify the SQL Server LIKE operator when querying for entities.

Related Links:GitHub Repo - https://github.com/AspNetMonsters/EP108-EFLikeOperator

Follow @aspnetmonsters

View Details

In this episode we take a look at how to retrieve secrets from Azure Key Vault for use in your ASP.NET Core application

View Details

Entity Framework Core 2 was released recently. In today's episode we explore a new feature called Global Query Filters. See how query filters can be applied globally to easily support features such as soft delete and even multi-tenancy.

Episode Sponsor:
AppVeyor - Continuous Delivery Services for Windows Developers

Related Links:
Code from the show on GiHub

Follow @aspnetmonsters

View Details

Entity Framework Core 2 was released recently. In today's episode we explore a new feature which automatically paramaterizes SQL Queries when the FromSql method is used with an interpolated string. Monster Dave shows us exactly why parametrized queries are so important when querying using raw sql.

Episode Sponsor:
AppVeyor - Continuous Delivery Services for Windows Developers

Related Links:
EF Core Injection Samples by Nick Craver
FormattableString - MSDN

Follow @aspnetmonsters

View Details

Did you know that you can deploy multiple applications to a single Web App in Azure App Service? In today's episode, Dave explores this virtually unknown feature of Virtual Applications in Azure App Service. Learn how to create a virtual application and how to deploy your ASP.NET Core application to that virtual application. 

Episode Sponsor:
AppVeyor - Continuous Delivery Services for Windows Developers

Follow @aspnetmonsters

View Details

Setting assembly and product version numbers as part of your build process is easier now in .NET Core. In this episode, Dave shows us how to specify version numbers for .NET core assemblies and NuGet packages using command line parameters and how easily that can be integrated into build systems like AppVeyor.

Episode Sponsor:
AppVeyor - Continuous Delivery Services for Windows Developers

Previous Episodes:
Hosted ASP.NET Core Builds with AppVeyor
Continuous Deployment with AppVeyor
Deploying a NuGet package with AppVeyor

Related Content:AppVeyor Docs - Environment Variables

Follow @aspnetmonsters

View Details

In this episode, we'll explore how to hook up Application Insights to your ASP.NET Core application using the really excellent Serilog.

Serilog - structured logging for .NET

Seq - structured log searching

Application Insights Serilog sink

Serilog connector for .NET Core Logging

View Details

Should we be checking in NuGet packages? Do we want to ensure that we can reliably recreate builds at a later date or do package managers handle all of that for use? In this episode, we try and get to the bottom of this quandary. 

Paket package manager: https://fsprojects.github.io/Paket/

Yarn packages manager: https://yarnpkg.com/en/

NPM5: http://blog.npmjs.org/post/161081169345/v500

View Details

Manually deploying NuGet packages to nuget.org can be a bit of a painful process. Fortunately, many build systems provide the ability to automate NuGet package deployment . In today's episode, Monster Dave explores deploying NuGet package using AppVeyor

Previous Episodes:
Hosted ASP.NET Core Builds with AppVeyor
Continuous Deployment with AppVeyor

https://www.appveyor.com/

Follow @aspnetmonsters

View Details

There are countless front-end workflows. In what we're hoping will be the first of a series of episodes on workflows we talk with noted front-end guru and JavaScript master David Wesst (https://blog.davidwesst.com/). JavaScript or TypeScript? Gulp or Grunt? Hear what one expert thinks is the best combination. 

View Details

Adding deployment steps to your build pipeline is a lot easier than it used to be. In today's episode, Monster Dave explores deployments and environment management using the AppVeyor hosted build service.

Previous Episode: Hosted ASP.NET Core Builds with AppVeyor

https://www.appveyor.com/

Follow @aspnetmonsters

View Details

A continuous integration (CI) build is a helpful tool for any software project. In today's episode, Monster Dave explores the AppVeyor hosted build service and shows just how easy it is to setup a CI build for your ASP.NET Core project.

https://www.appveyor.com/

Follow @aspnetmonsters

View Details

In our last episode we set up a Docker container using Windows Containers, in this episode we'll talk a bit about messaging and then send a message using RabbitMQ. 

References:

ASP.NET Monsters blog on RabbitMQ

MSDN on different message types

RabbitMQ Docs

View Details

Docker is now fully sported on Windows 10. In this episode we'll see what it takes to avoid installing RabbitMQ locally and, instead, use a Windows container. Keeping RabbitMQ in a container allows standing up a cluster on one physical machine, greater ability to experiment and a high degree of isolation. In the future we expect that a great deal of local development will leverage containers. 

View Details

React is a fantastic view engine and one of its best features is that it can be attached to pre existing markup. This allows us to render out HTML on the server side and then hookup React to it once all the JavaScript has been downloaded and started. We can get the best of single page application and the best of full web applications. In this episode we mash on speeding up single page react applications on the server.

References

React.net Tutorial

Are they isomorophic or universal

View Details

ReacJS is a very popular front-end view engine for JavaScript. In this episode we'll make the simplest possible React application on the way to doing some fun stuff with it. 

References

React - https://facebook.github.io/react/

View Details

In today's episode, Monster Dave prototypes an approach to generating static resource URLs to potentially improve the performance of an ASP.NET Core application. Borrowing ideas from a recent blog post by the Facebook engineering team.

First, we create a tag helper to generate static resource URLs based on a hash of the file's contents. Next, we write some custom middleware to rewrite those new URLs to the actual file and to always return 304 not-modified for all conditional requests.

The Blog Post: https://code.facebook.com/posts/557147474482256

Follow @aspnetmonsters

NOTE: This video is intended to explore the concepts outlined in the blog post above and are not be suited for production use.

View Details

Middleware and filters both seem to fill similar needs in the ASP.NET Core MVC space, so what separates them, and when would you choose to build one over the other?

Join Monster James in this episode to find out more about the intent of each feature of ASP.NET and when to elect to create custom middleware or build a filter for your actions. 

Follow @aspnetmonsters

View Details

In today's episode, Monster Dave takes is through the magic that happens in MVC when converting strings from an incoming request to DateTime types in a controller. (Spoiler alert, it's not actually magic).

Related Links:

ASP.NET Monsters #77: Internationalization Part 2 - Request Localization

ASP.NET Monsters #77: Internationalization Part 2 - Request Localization

Standard .NET Date Time Formats

Follow @aspnetmonsters

View Details

Learn how to build complex URL Rewrites without messy XML configuration.  In today's episode Monster James gives us a quick tour of the new URL Rewrite middleware in ASP.NET Core.

NuGet Package

Follow @AspNetMonsters

View Details

Have you ever wondered how scripts are inserted into your layout from a view, or how the debugger knows which line of code you are on when you're using partial views? 

In this episode, Monster James dives into the classes that are generated automatically behind the scenes and ultimately compiled at runtime to give your application the capabilities required to generate HTML for your client.

More reading:

  • Read about the RazorPage class that your views inherit from
  • See the code discussed in this episode in RazorTemplateEngine
  • Check out the Monsters' book - ASP.NET Core Application Development

Follow @aspnetmonsters

View Details

If you've used Visual Studio 2015 then you've used the Roslyn managed compiler. Roslyn is unlike most any other compiler in that it offers a simple approach to adding your own warnings and errors to the build pipeline. In this episode we'll build a simple analyser. Our American friends might know these as "Analyzers".

References

C# and Visual Basic - Use Roslyn to Write a Live Code Analyzer for Your API

View Details

Earlier in November, the ASP.NET Monsters had the opportunity to take part in the ASP.NET Core hackathon at the Microsoft MVP Summit. In past years, we have used the hackathon as an opportunity to spend some time working on GenFu. This year, we wanted to try something a little different.

In this episode, we explore our monstrous creation: Pugzor, an alternate view engine for MVC built with Pug and Node Services.

Related Links:

Episode #82 - Node Services

Pugzor on GitHub

Blog Post

Follow @AspNetMonsters

View Details

We love ASP.NET but we also love web stuff in general. In today's episode we take a quick look at building a simple service using Suave the F# web framework. 

References:

Suave Web Services

suave.io

Chiron

View Details

Entity Framework Core makes it easy to write tests that execute against an in-memory store but sometimes we want to actually run our tests against a real relational database. In this episode, Monster Dave looks at how to create an integration test that runs against a real SQL Server database.

Blog Post
GitHub Repo

Follow @aspnetmonsters

View Details

Today we have the pleasure of announcing the release of a new source of reference for building an application in ASP.NET Core MVC. Over the last two years we have had the great fortune of serving the ASP.NET community, sharing in our learning, getting tonnes of feedback and having a great time exploring the next version of ASP.NET.  In this episode, we shamelessly plug the table of contents for our newly released book. Join the Monsters to hear more about what is sure to be a timeless classic, coffee table material in every household. The Book - ASP.NET Core Application Development Follow @aspnetmonsters

View Details

I can't remember if NodeJS is still cool or if people are only using it ironically now as they port their applications to something else. In either case there are still a lot of great node modules out there which it would be great to access from our ASP.NET application. In this episode we'll look at Node Services an approach to call out to Node from inside an ASP.NET MVC Core controller. 

Follow @aspnetmonsters

View Details

A new feature in ASP.NET Core 1.1 allows us to invoke view components as tag helpers. Monster Dave shows us how to enable this new feature.

Related Episode - View Components

Follow @aspnetmonsters

View Details

ASP.NET Core 1.1, .NET Core 1.1, EF Core 1.1 and a multitude of other packages have all been released, but is now the time to adopt?

In this episode Monsters Dave and James talk about the release of ASP.NET 1.1 and how it will affect your projects. They mash on the tooling, upgrading a package and their experiences so far and hint at a few topics that are coming in future episodes.

For additional details on the release, be sure to check out these links:

  • The ASP.NET Core 1.1 announcement
  • The .NET Core 1.1 announcement
  • The change manifest with all the updated packages

Please follow the @aspnetmonsters, like and share, or comment and ask questions below.

View Details

If you're looking for content that will walk you through, step-by-step, as you transition to ASP.NET Core MVC, you're in for a treat.

In this episode of the Monsters, Jon Gallaway joins us live on set at Channel 9 studios to talk about the .NET Core community, the Community Standups and, of course, a series of free labs that you can dive into to embrace your inner Core and learn more about the future of MVC.

Check out the labs yourself on GitHub:

  • Code Labs
  • ASP.NET Core Workshop

Please follow the @aspnetmonsters, like and share, or comment and ask questions below.

View Details

Azure Functions have just gone "GA" and are a great way for you to truly leverage the promise of the cloud and it's ability to scale. In this episode of the Monsters, we have a special guest from the Functions team to break down some of the basics and help us wrap our heads around the Azure offering. 

Join Chris Anderson and the ASP.NET Monsters at the Channel 9 studios as they chat about Azure Functions.

Check out these links:

  • Monster James chews on Azure Functions for 5 days in this series
  • See the C# developer reference for Azure Functions

Follow @aspnetmonsters

View Details

Are you ready for more Internationalization? Monster Dave talks about the Request Localization Middleware in ASP.NET Core and the three built in RequestCultureProviders.

Links:

Internationalization Part 1

ASP.NET Core Docs

Follow @aspnetmonsters

View Details

Postman is a great tool for exercising HTTP endpoints but sometimes you need a tool you can run in a script or you don't have access to postman. In that case curl is your friend. In this episode Simon takes us through the basics of curl running on Ubuntu on Windows. 

You can read more about curl at 

https://curl.haxx.se/docs/manpage.html

Follow @aspnetmonsters

View Details

In today's episode, Monster Dave takes us through the IStringLocalizer and IViewLocalizer services used to support text localization in an ASP.NET Core MVC application.

Links:https://docs.asp.net/en/latest/fundamentals/localization.html

Be sure to check out the second episode in internationalization too: find it here.

Follow @aspnetmonsters

View Details

You want to treat your CSS like versioned code but still be able to take advantage of updates to CSS frameworks and libraries like Bootstrap 4. How do you make that work?

In this episode Monster James shows us how to frame up your project in such a way that you can customize variables, colors, sizes and even select which components are included in your custom version of Bootstrap, all the while maintaining an upgrade path and building from Bootstrap source.

Here's some other episodes mentioned in the episode:

  • Hello Bundler Minifier with Mads Kristensen
  • Compiling a Custom Bootstrap Template with Gulp

Follow @aspnetmonsters

View Details

For many developers, deployment may no longer be the same-old, same-old process of delivering an application to be hosted in IIS running on a Windows server. In fact, for any ASP.NET Core MVC application, your application will be running in Kestrel, but as a host Kestrel doesn't support things like SSL termination, multiple port binding or multiple host headers? How are we going to make this work? And what is a reverse proxy?

Check out these previous episodes on nginx and kestrel:

  • An Intro to Nginx
  • Nginx, Kestrel and SSL

Looking forward to your comments and questions!

Follow @aspnetmonsters

View Details

.NET Standard is a new way of thinking about the API surface area of various different .NET frameworks and the platforms on which they run. Moving away from the confusion of portable class libraries .NET Standard allows for easier to comprehend libraries support matrices and a low friction approach to building libraries. 

References 

XKCD - Standards

Introducing .NET Standard

.NET Standard Platform

Follow @aspnetmonsters

View Details

Can you believe we've gone 70 episodes without talking about unit testing in ASP.NET Core? We've avoided it for as long as we could and it's time to finally write some times. Join Monster Dave as he gives us a brief overview of xUnit and unit testing in ASP.NET Core!

Additional Resources:
Microsoft Docs on Unit Testing
xUnit Docs

Follow @aspnetmonsters

View Details

In some situations, it might be convenient to have access to some ViewData, ModelSate or even HttpContext information from within a Tag Helper. Join us as Monster Dave shows us how to do just that using ViewContext.

Follow @aspnetmonsters

View Details

Logging can help give you critical information about what was going on in your system when things went south. But how do you keep track of details for a request when the logs span multiple services? Join Monster James in this episode to discover how you can leverage logging scopes to help filter out a segment of a request and all the details related to a particular section of code.

Follow @aspnetmonsters

View Details

In this episode we examine the way that MVC activates components using a set of default conventions, and we add a new convention that modifies the available actions available at runtime.

Here's some links related to this episode:

  • Sample project on GitHub
  • Blog post with deep dive and more details

Follow @aspnetmonsters

View Details

There are a number of ways to get your JavaScript from the server to the client, using loaders or zipping files. In this episode the Monsters talk off the cuff about how to move files from the server to the client. They also, weirdly, forget to talk about CDNs. 

Follow @aspnetmonsters

View Details

Cross site scripting attacks or XSS are still one of the most common ways to attack a website. If you're not properly sanitizing your inputs then you too could be vulnerable. Thank goodness that Content Security Policy headers came along to offer us a powerful tool to avoid falling pray to these attacks.

Resources

CSP header generator http://cspisawesome.com/

Follow @aspnetmonsters

View Details

Have you ever wanted to check if a user is authorized in code instead of using the Authorize attributes for a Controller / Action method? In today's episode we dive in to the IAuthorizationService which allows you to programmatically check if a user is authorized.

Follow @aspnetmonsters

View Details

SSL is a fabulous tool for encrypting your HTTP sessions and it is becoming cheaper every single day. However there are still some possible attack vectors even if your site uses HTTPS. In this episode we'll take a look at the HTTPS Strict Transport Security (HSTS) headers and how you can set them up to close one of the loopholes in SSL.

Links!

OWASP cheat sheet on HSTS

HSTS Preload List

Andrew Lock on ASP.NET Core Security Headers

Follow @aspnetmonsters

View Details

Action parameters in ASP.NET Core MVC are automatically populated for you (as best they can be by the default model binder) from the incoming request using a series of conventions. You can bind primitives and complex types, lists, and even lists of complex types. Join Monster James as he walks through all of these concepts.

Be sure to check out our previous episode on routing, which explains the premise of route tokens discussed in this video.

Follow @aspnetmonsters

View Details

Retrieving data using the HttpClient is a fairly common practice in any number of applications, but HttpClient can easily be used incorrectly frequently with dire consequences. Make sure you're using it correctly in the latest ASP.NET Monsters video. 

Here are some references and other interesting reads:

  • Our blog post on this
  • Microsoft Patterns and Practices documentation
  • Official documentation (careful with this)

Follow @aspnetmonsters

View Details

It's the moment you've all been waiting for....here are the winners of the ASP.NET Monsters Summer of Config contest!

The Summer of Config was all about creating the wackiest, most insane configuration provider that you can dream up and boy did our viewers deliver!

Visit the contest announcement page for all the details on the contest.

Thanks to everyone who participated!

Follow @aspnetmonsters

View Details

In this episode of the Monsters we are joined by community expert Darrel Miller, and we talk about a wide variety of API development topics ranging from standards to best practices to doing things wrong (i.e., anything to do with versioning). We also have a pretty good chat about API Management in Azure (Darrel is on that team, making it better one byte at a time).

Follow @darrel_miller

Follow @aspnetmonsters

View Details

Join Monster Dave as he takes a deeper look at queries generated by Entity Framework Core. Learn how to generate efficient SQL queries using LINQ Projections as we continue building RawwwwR, our almost functional Twitter clone.

Related Episode:

EP57 - Loading Related Data with EF Core

Follow @aspnetmonsters

View Details

In today's episode, we learn about Razor from special guest Taylor Mullen. Taylor works for Microsoft on the ASP.NET team where he works on the Razor view engine.

Regardless of whether or not you've been on MVC for some time, or if you've continued on with Web Forms, chances are you seen or worked with Razor. Further odds suggest that you may have learned syntax, but a lot of folks (Monsters included!) still had questions about the inner workings.

Why are there different ways to switch to code? How can I be more terse in my syntax? More explicit? And where have the bumblebees gone? Fire up Visual Studio and mash along with us as we dive into the details of Razor syntax.

For more information on topics in this episode:

  • Check out the github repo for the ASP.NET team
  • Read the docs on the Razor Syntax Reference page

Be sure to check out Taylor on Twitter.

Follow @aspnetmonsters

View Details

In an earlier episode we explored how to use Nginx to front a Kestrel server. In this episode we will explore adding SSL and HTTP 2 using Let's Encrypt for a free certificate. 

References:

Our blog post about doing this: http://aspnetmonsters.com/2016/08/2016-08-07-nginx2/

Nginx home page: https://www.nginx.com/

SSL labs test tool: https://www.ssllabs.com/ssltest/

View Details

Entity Framework Core doesn't support lazy loading yet which means you need to explicitly tell Entity Framework what related data to include when querying for an entity. In today's episode, Monster Dave shows us how to load related data using the .Include and .ThenInclude extension methods.

Follow @aspnetmonsters

View Details

In this bonus episode we update everybody on the new expanded prize packages for the Summer of Config contest. We already have some amazing entries using things like Twitter or GPS to configure applications. Still plenty of time to get your entry in. I haven't seen anybody configuring their application based on a lava lamp or on the position of Jupiter in the night sky. With the expanded prizes you'd be crazy not to enter.

Check out the contest announcement video  or read the blog post or watch the video that started it all

View Details

Shiny new things are shiny and new! ...but that kind of argument isn't going to win you management over when you explain to them that you need to take your team offline for the next 6 months while you rewrite the app on ASP.NET Core.

But! There will be a right time for your team, and likely a right approach, too. Join special guest Jeffrey Palermo with Monsters Simon and James as they mash on the finer points of making the move to .NET Core. In this episode, they talk about the pitfalls you might run into, some safe approaches you can take and tips that will help you along the way as you focus on features instead of technology. 

Do you have questions about when or if it's right for your team? Ask us in the comments below!

You can catch up with Jeffrey on the Twitters.

Follow @aspnetmonsters

View Details

The dotnet tool will, by default, produce a .dll file even if you've asked it to emit an entry point and you're building a command line tool. What should you do if what you want is really a .exe file? What has changed in .NET Core compilation overall?

Watch today's episode to find out!

Some helpful resources:

  • Source code to ls - ls.c on Simon's favorite *nix
  • Ahead of time compilation repo on github

Hey! Got some questions? Ask us in the comments section below!

Follow @aspnetmonsters

View Details

Controller from both MVC and Web API have been merged into the same code base, so creating APIs are even easier and as lightweight as we'd like (or as feature-rich as we need).

Authentication and authorization work well, but we have to be aware of the pitfalls and the different contexts under which we may be exposing our APIs to the outside world. In this episode, guest Monster Eric Fleming cracks open a new API controller and starts returning some data, then we dive in to see how basic security only stands up to basic attacks. 

Watch for a future episode when we take additional measures to protect the API even further.

Follow @aspnetmonsters

View Details

View Components are a new feature in ASP.NET Core MVC and they provide a great way to build small components that can be reused across your application. In today's episode, Dave shows us how to load view components from a class library so they can be shared across several applications.

Resources

Blog Post
GitHub Repo

Follow @aspnetmonsters

View Details

Kestrel is a great light weight server for serving ASP.NET Core web applications. However it doesn't support such things as SSL or gzip or http2. In order to get that functionality you need to put another web server in front of it. Nginx is a great feature rich web server which can act as a front for Kestrel. In this episode we'll explore some of the configuration options for Nginx. 

Resources

Monsters post on Nginx

Nginx site

View Details

Awwwyeah, here it is, the next contest brought to you by the ASP.NET Monsters. We have some great prizes and we're sure hoping that you can have a lot of fun, even if you don't cash in with the win.

The Summer of Config is all about creating the wackiest, most insane configuration provider that you can dream up. We want you jammin' on the ASP.NET Core code, bringing us your questions, experimenting with the code and seeing your creativity. BRING IT ON!

Visit the contest announcement page for all the details.

Good luck!

Follow @aspnetmonsters

View Details

We're not quite sure if it's time to rethink how or where we think of and save out our configuration, but with the evolution of configuration in ASP.NET Core, we know that it's at least possible to do so. In this episode, join the Monsters as James demonstrates how to store configuration information in an image in what might possibly be "the best use of computers ever."

While this is a lighthearted episode for sure, it does dive into the complete technical implementation of a custom configuration provider with the capability of refreshing itself when the file containing the configuration is updated.

Here's some other, related episodes on Configuration:

  • Working with User Secrets
  • Configuration Settings in ASP.NET Core
  • Configuration From a Database

Follow @aspnetmonsters

View Details

Got your app all ready to ship but nowhere to ship it to? Why not try Azure? In this episode we deploy our application to Azure App Services. 

Here are some links for you to chew on:

  • Publishing in the ASP.NET Docs
  • Channel 9 video from dotnetConf

Follow @aspnetmonsters

View Details

The patterns used for configuring Entity Framework Core are a little different when compared to previous versions of EF. In today's episode, Dave takes us through the OptionsBuilder pattern and a couple different methods of wiring it up to your DbContext classes.

Related Episodes:

  • JSON Data and the Options Pattern
  • State of EF Core

Follow @aspnetmonsters

View Details

Are you getting ready to start exploring ASP.NET Core? Have you considered which ORM you're going to work with? In this episode the Monsters ~~kidnap~~ are joined by special guest Julie Lerman to talk about EF Core, the next version of Entity Framework.

There are new great things, but there are also pieces you may have grown accustomed to that are no longer (or not yet) in EF Core. We talk about the move to open source, options we have, some best practices and some great tips to help you keep your project on track and decide what the right strategy may be for your team.

Here are some links to help get you up to speed:

  • The EF Core Roadmap
  • The EF Core project on GitHub
  • Julie's Pluralsight latest course on EF6

Follow @aspnetmonsters

View Details

Dotnet Core runs on a whole bunch of different platforms but not everything is the same between platforms, how can we adjust for different platforms? In Linux and OSX we use sensible line endings while on Windows we use two characters. File path separators are also different. Join the monsters as they look at how to handle that. 

References: 

The amazingly long github bug for getting runtime information: https://github.com/dotnet/corefx/issues/1017

Follow @aspnetmonsters

View Details

If you have complex object graphs that you'd like to use in your prototype or test data, chances are you have a swamp load of muck to write to wire those objects up, especially if you want your data to look realistic.

In this episode of the ASP.NET Monsters, James walks us through creating sample data in more complicated scenarios where properties need special weighting of random distributions, where setter methods need to be invoked, or where you need to compose properties and object graphs.  All of this is done with the GenFu library.

See our intro to GenFu here.

GenFu is an opensource project created and curated by the Monsters on GitHub.

You can try GenFu out live on our sample site.

Follow @aspnetmonsters

View Details

.NET Core 1.0 is officially released and Monster Dave decides to take Linux for a spin. Join us for a tour of developing with .NET Core on Ubuntu Linux. Watch Dave show off his rusty Linux skills and see how he manages to solve a problem by debugging his test app with Visual Studio Code.

Follow @aspnetmonsters

View Details

In today's episode, Mads Kristensen sets us straight on the new Bundler Minifier and the direction the ASP.NET team has decided to take in the default project template. Mads takes us through the Bundler Minifer, what it is capable of, how it differs from System.WebOptimization and Gulp, and most importantly why it exists in the first place.

Looking for the repo we were talking about in the show? You can find it here on GitHub.

Follow @aspnetmonsters

View Details

A special guest episode with fellow Canadian ASP.NET MVP Maxime Rouiller. In this episode we talk about how the ASP.NET Core team have been pulling back on some cool technologies, especially gulp. Watch to see if we think it is a mistake. 

Follow @aspnetmonsters

View Details

I hear tell that you can't access SQL server from ASP.NET Core. That's simply not the case! In this episode we jam on connecting an ASP.NET Core application to SQL server. 

In this episode we make use of the fantastic Dapper library for light weight ORM functionality. 

Dapper.net
https://github.com/StackExchange/dapper-dot-net

Release notes for SQL Data Access

https://github.com/dotnet/core/blob/master/release-notes/1.0/Release-Notes-RC2.md#data

Follow @aspnetmonsters

View Details

There are many legitimate reasons why you'd want to allow your application to share data with other sites, but we don't want to do it in such a way that it allows wide-open access to your API or controller surface area. Often, we have a set of resources we want to share, with a set of origins that we trust to use our site appropriately.

Browsers today do not allow Cross Origin Resource Sharing by default, but because of the way the request-response works, you can enable it on the server where the resource is located. In this video, Monster James explains how to relax the default server policy and enable CORS for trusted origins.

For more information on the security vulnerabilites avoided by disabling CORS by default in the browser, please check out this entry in Wikipedia.

Follow @aspnetmonsters

View Details

If you've already got a built-in data store and want to extend your API to a third party service, chances are you'll need a way to let those users call into your application in a secure way. 

In this episode, Monster James dives into a mechanism to create per-user tokens that can easily be revoked or invalidated, while still providing a straightforward way for callers to self-generate the access artifacts they need to use your API.

Note that in broader scenarios something more akin to IdentityServer might be more suitable, allowing different scopes and sets of claims for users who log in through different contexts (web versus API, for example). You can find out more about IdentityServer on GitHub and in a future episode of the Monsters.

Follow @aspnetmonsters

View Details

One of the best things about .NET Core is that it is portable to other platform not just for deployment but for development. If you're running on Linux or OSX then you won't have access to the full version of Visual Studio. That might be good or it might be bad depending on your point of view. There are tools in place, however, to help you out if you don't use Visual Studio. One of these tools is Yeoman. 

Yeoman is a templating tool which allows you to generate whole projects or just individual files from templates. Similar to the way you right click add and select a template in visual studio Yeoman is cross platform and it is great.

If you're interested in more information about Yeoman check out these links: 

  • http://yeoman.io/ - Home page for Yeoman
  • https://github.com/omnisharp/generator-aspnet - Github page for OmniSharp's Yeoman templates

Follow @aspnetmonsters

View Details

Have you ever wanted to change the default Bootstrap colors and styling but weren't sure how to do that without making Bootstrap upgrades difficult to manage?

In today's episode, Monster Dave shows us how easy it is to customize Bootstrap and compile it from source using Less and Gulp.

Show Links:

LESS plugin for Gulp -> https://www.npmjs.com/package/gulp-less

Bootstrap -> http://getbootstrap.com/

Follow @aspnetmonsters

View Details

When you want to cache more than view fragments and save time reprocessing expensive operations in your services, chances are there is a way to speed up your application by leveraging cache. When you need more than one application server, a distributed cache is required to support your application so that all app servers can take advantage of the speed boost.

In this episode, Monster James dives into a sample scenario of using an Azure Redis cache instance as the backing store for lookups in a service that is used in an ASP.NET Core MVC application.

Here's some other entries on caching that you might be interested in:

  • Distributed Cache Tag Helper
  • View Output Caching
  • In-Memory Caching on your App Server

Follow @aspnetmonsters

View Details

The anxiously awaited ASP.NET Core RC2 has finally landed and with it we have a shiny new tag helper to explorer.

In today's video, monster Dave takes us through the new Distributed Cache tag helper and how it differs from the Cache tag helper we explored in Episode 21.

More details available here: http://aspnetmonsters.com/2016/05/2016-05-22-ASP-NET-Core-Distributed-Cache-Tag-Helper/

Follow @aspnetmonsters

View Details

In episode 34 the blue monster, Simon, discusses the basics of routing

  • Where are routes defined?
  • What's the default route?
  • How can you add additional parameters to be extracted from the route

For more information about routing  you can checkout 

http://www.codethinked.com/exploring-systemwebrouting

and the soon to be added https://docs.asp.net/en/latest/mvc/controllers/routing.html

Follow @aspnetmonsters

View Details

It finally happened! The long awaited ASP.NET Core RC2 has arrived. In today's episode, monsters Simon and Dave discuss RC2 and changes to the File - New Project templage. We also weigh in on the project.json controversy and talk about why some bits are still labeled as "Preview 1".

Follow @aspnetmonsters

View Details

When you don't want to make a trip to the database or an external service on each request, caching provides a mechanism to help improve performance and make your site hum along nicely.

In this episode, Monster James configures a simple caching scenario in an ASP.NET Core MVC application and demonstrates how to configure sliding and absolute expiry, along with setting options for cache priority.

Some other videos to help you along with features mentioned in this video:

  • Configuration in ASP.NET Core (and this one)
  • Logging in ASP.NET Core
  • Using the Cache Tag Helper

Follow @aspnetmonsters

View Details

The process for referencing and updating client side packages has changed in ASP.NET Core. Instead of using Nuget for packages like jQuery and Bootstrap, the default project template uses the Bower package manager.

Join Monster Dave as he walks us through using Bower to update to the latest alpha bits Bootstrap 4. We'll cover the Visual Studio tooling and the new Tag Helpers related to referencing JS and CSS files. 

Related Links:

http://bower.io/

http://blog.getbootstrap.com/2015/08/19/bootstrap-4-alpha/

Follow @aspnetmonsters

View Details

In episode 30 we attempt to get dotnet running on OSX by following the directions on the website. Things don't go quite as well as hoped and Simon ends up trying to read the C++ source code for dotnet to figure out why things aren't working. 

Turns out that dotnet is not supported on OS X 10.9 https://github.com/aspnet/PlatformAbstractions/issues/23 We'll update and try this again later. 

Links

http://dotnet.github.io/getting-started/#/macosx

Horrible looking C++ which is probably the problem

Thanks to Andy or @Inumedia who gave out sage advice on the dotnet/cli Gitter channel. 

Follow @aspnetmonsters

View Details

When things go sideways in application development, it's certainly helpful to have more than just the dreaded yellow screen of death.  ASP.NET Core has really augmented the developer experience via some interesting extensibility points that you can leverage from the default template.

Join Monster Dave as he walks us through the different developer pages that ship with the default template. We'll also talk a little about the kinds of ways you could use this approach in your projects with custom middleware of your own.

Follow @aspnetmonsters

View Details

Yes! You can accept payments in your ASP.NET Core applications. Third party payment processing systems have really come of age and made it not only simple for you to start collecting payments, but also help to keep your users' personal information - such as credit cards - private...and more importantly off your server.

In this episode, Monster James shows us how to create a system for accepting user information, creating subscriptions using the Stripe.net NuGet package and integrating all of that into our application. We'll use the Stripe.js library to negotiate a token representing the user's credit card data and never have to submit the sensitive bits to our server.

This episode will also make use of some other features we've previously covered:

  • User Secrets
  • Configuration Settings
  • The Options Pattern (for strongly-typed configuration)

Follow @aspnetmonsters

View Details

Some monsters like rice pudding, some monsters like to do automotive repair but these monsters like containers. Containers of what? To day containers of Windows. In this episode we show off a simple right click deploy of our project to a Windows container running on Windows 2016 on Azure. That's right, it is 2016, and we don't need no stinking Linux our ASP.NET apps in containers!

If you're interested in learning more about Windows Containers then check out 

  • https://msdn.microsoft.com/en-us/virtualization/windowscontainers/about/about_overview
  • https://developer.rackspace.com/blog/run-sitecore-in-a-docker-container-on-windows-server-2016/
  • https://weblogs.asp.net/scottgu/announcing-windows-server-2016-containers-preview

Follow @aspnetmonsters

View Details

When your primary market is fellow developers, having GitHub authentication is a great way to allow your users to engage with your site without requiring them to sign up on yours, while still providing a means to create and manage user-specific data in your application.

In this episode, Monster James walks us through the process of getting GitHub authentication working in an ASP.NET Core application using the OAuth authentication provider. 

Follow @aspnetmonsters

View Details

Action filters can be used to annotate action methods in ASP.net - that's not new. But in ASP.NET Core the filters can participate much more fully in the dependency injection story. You no longer need to jump though container specific hoops or make use of a service locator pattern. As an added bonus in this episode James throws Simon under the bus and makes him write GenFu code on the fly.  

Read all about filters in the official documentation at https://docs.asp.net/en/latest/mvc/controllers/filters.html

Follow @aspnetmonsters

View Details

If you need a way to bundle up bits of UI and related behind-the-scenes logic, chances are you're looking for View Components in ASP.NET MVC. This feature of the MVC Framework lets you build reusable components in a new way that better participates in the HTTP request and controller lifecycle.

In previous versions of the MVC Framework, we had child actions, but those have gone the way of the dodo. In this video, Monster Dave walks us through leveraging View Components - including a brief cross over into dependency injection - in our Razor views.

Follow @aspnetmonsters

View Details

If you're working on a project where you'll be sharing code with someone else, particularly if you're keeping the source code in a public repository, you're going to want to make sure that sensitive data is separate from your project. This includes things like API keys, tokens for services and perhaps passwords or other similar data.

In this LIVE RECORDED video, Monster James has a look at the user-secret command and walks through using the command line as well as the tooling built into Visual Studio.

Here's some other, related links:

  • Configuration Settings in ASP.NET Core
  • Configuration From a Database

Follow @aspnetmonsters

View Details

In this episode, Monster James walks you through the basics of prototyping a new feature in your application without having to do the grunt work of creating all the data you need to light the feature up in your UI.

GenFu is an open source library (created by the Monsters!) that allows you to save hours of work when you're asked to create lists of data to support a test or prototype. When you build out a user experience it's often better to have data that looks realistic, which is old-hat for GenFu. Need 10,000 rows of data in your DB? Yeah, it can help you do that, too.

Be sure to check out our follow-up episode when we dive into even more advanced use cases.

Check out GenFu:

  • On GitHub
  • On NuGet
  • On a working try-it-out-for-yourself site

Follow @aspnetmonsters

View Details

In this episode, Dave takes us through caching Razor output using the ASP.NET Core MVC Cache Tag Helper. We look at the different ways you can think about how to break down a page and how it can relate to optimizing your site's performance.

While not everyone will need the benefit of output caching, any site with multiple web servers running, all accessing the same backend services should likely consider the merits. While other layers and services may provide their own approaches to minimizing resource-intensive lookups, this is just one other tool in the belt to help keep your site snappy.

Follow @aspnetmonsters

View Details

Join us for a quick tour of the Documentation and GitHub repos for ASP.NET Core.

In this episode, Dave shows us how to browse the code base, where to log issues and how to engage with the ASP.NET development team on GitHub (github.com/aspnet). We take a quick spin through the fancy new Read the Docs site (docs.asp.net).

Follow @aspnetmonsters

View Details

Back in Episode 7 we looked at creating custom tag helpers in ASP.NET Core MVC. This week, we take a look at a more advanced scenario where a custom tag helper can be used to cleanup our markup and help enforce consistency

Dave walks us through building a tag helper that is made up of multiple parts. He shows us how to use the TagHelperContext to communicate between parent and child tag helpers while Simon engages in an epic battle with the mysterious green ooze.

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

Follow @aspnetmonsters

View Details

Building and packaging is super fun with the new build framework in ASP.NET Core.  In this episode we take a look at how to hook into the various different stages of the build. There is a bit more about the build hooks at https://docs.asp.net/en/latest/dnx/projects.html#scripts

Build hooks are entry points into the build pipeline that allow you to interact with the build system, assets in your project or artifacts that result from the build. These are a powerful tool for developers and can be used for a variety of scenarios.

Follow @aspnetmonsters

View Details

In our previous episode we had a look at the built-in mechanisms which we are afforded by virtue of using ASP.NET Core. Now it's time to take a deeper look at a fundamental concept to modern logging - structured log messages - and how to take advantage of it.

In this installment in our series, Monster James is diving into what it takes to use a third-party logging library and an HTTP logging service to capture serialized, structured logs. We'll look at an installation of Seq to capture the logs, and Serilog to push logs to the server. 

Follow @aspnetmonsters

View Details

So you're planning on sending your app out into the wild. Have you thought about what is going to happen when things go sideways? How will you recover when the excrement hits the oscillating device? Without having a reliable way to track down what went wrong, you'll be in the weeds for sure, but logging will help set things right.

In a departure from previous iterations in MVC, the default template is set up and ready to go for logging. Your project will give you fairly detailed information out of the box at a framework level, and all you need is a few small tweaks (and to lean on DI a little bit) to get logging going in your controllers.

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

Follow @aspnetmonsters