MSDN Blogs

Controlling Model Binding in ASP.NET Core

Mon, 09/17/2018 - 11:23
Model binding works great ... but it sometimes lets me down. In those cases you need to tell model binding to do the right thing. Here's an attribute that will let you know when you're missing non-nullable data and do it without interfering with your data design.
Categories: Microsoft

Adding Your Own Files to Your Visual Studio Solution

Tue, 08/07/2018 - 12:11
Visual Studio is perfectly willing to work with any file that you want to add to your solution -- you just have to tell it what editor to use.
Categories: Microsoft

Switching Your Xamarin Project to Standard Class Projects

Mon, 08/06/2018 - 12:42
If you're building a Xamarin solution you should be using a .NET Standard Class library to hold your common code. Here's how to convert an existing Xamarin Solution using a Shared or PCL project to the new standard.
Categories: Microsoft

Organizing Test Cases

Wed, 08/01/2018 - 14:35
As the number of your automated tests starts to pile up, using "Run All" to make sure that you haven't introduced any new bugs starts to look less attractive. Fortunately, Visual Studio makes it easy to organize your tests into groups.
Categories: Microsoft

Eliminate Code and Add Functionality with Fody Attributes

Mon, 07/23/2018 - 12:23
If you're not using Fody then you're probably writing too much code.
Categories: Microsoft

The Simplest Way to Create an Asynchronous Method

Mon, 07/23/2018 - 12:22
Just load something into the Task object's Result property.
Categories: Microsoft

Use JavaScript Code from One File in Another File with IntelliSense

Mon, 07/23/2018 - 12:21
Script references aren't just for TypeScript developers.
Categories: Microsoft

Overriding Controller Authorization in ASP.NET MVC

Wed, 07/18/2018 - 10:58
One of the nice things about many of the ASP.NET MVC action filters is that you don't have to apply them to every Action method -- you can bang one onto a Controller to cover all the methods in the controller. But what if you have one method that doesn't fit the mold?
Categories: Microsoft

The New Cross-Platform Standard: Version 2.0

Tue, 06/26/2018 - 09:29
Microsoft has changed strategies for supporting cross-platform development: They've moved from Portable Class Libraries to Standard Libraries. Here's why, what it means and why it matters right now.
Categories: Microsoft

Dealing with Read-Only Files

Wed, 06/20/2018 - 11:00
Here's how to avoid the frustration of discovering that you've made changes to a file you can't change in Visual Studio.
Categories: Microsoft

Disposing of the DbContext Object

Mon, 06/18/2018 - 17:14
While the DbContext object has a Dispose method, you don't really need to use it ... with one exception.
Categories: Microsoft

URL Rewriting vs. HTTP Redirects

Mon, 06/18/2018 - 17:13
ASP.NET code gives you enhanced ability to rewrite URLs to redirect client requests. But that leads to a key question: When should you use this new ability?
Categories: Microsoft

Converting DataTables to JSON

Tue, 05/29/2018 - 08:00
Sometimes your applications have to combine older technology with newer practices. Here's one example of how to keep your code up to date without replacing it.
Categories: Microsoft