sample-project

All posts that include links to a sample project on GitHub.

ASP.NET Core Demystified - Razor Pages

ASP.NET Core 2.0 was released just a few weeks ago, and included a new feature that may be the biggest single addition to ASP.NET Core since it was announced: Razor Pages! Come along with me as we figure out what Razor Pages are for, how they are used, and why they might be a helpful addition to our development toolbox. What are Razor Pages? Razor Pages are a new feature in ASP.NET Core 2.0, and... Read more >

ASP.NET Core Demystified - Action Results

Next up in our ASP.NET Core Demystified series, we will discuss and demo a whole bunch of classes which implement the IActionResult interface and inherit from the corresponding ActionResult class. These classes are used as responses from controller actions, and include redirecting to another site, redirecting to a different controller action, returning a JSON object, and returning a file to the browser. In this post, we will first discuss the IActionResult interface and what it needs, and then we... Read more >

ASP.NET Core Demystified - Model Binding in MVC

For the next part of my ASP.NET Core Demystified series, we're sticking with MVC and explaining how the model binding system works. As with all my Demystified series posts, there's a sample project over on GitHub which contains the sample code used here. Check it out! What is Model Binding? Model Binding is the process by which ASP.NET Core MVC takes an HTTP request and "binds" pieces of that request, as well as other data sources,... Read more >

ASP.NET Core Demystified - Routing in MVC

ASP.NET Core MVC has introduced quite a few concepts that new (or new-to-ASP.NET) web developers might have some difficulty getting caught up with. My ASP.NET Core Demystified series is designed to help these developers get started building their own custom, full-fledged, working AASP.NET Core applications. In this part of the series, we'll take a look at the concept of Routing and how we can use it to match URLs with actions. As always with my tutorials,... Read more >

Extending RestSharp to Handle Timeouts in ASP.NET MVC

We're working on a large project which consumes a custom-build API, and one of the requirements of this project is that if the API goes down, certain sections of the website still need to be able to function. The reason for this is that our app consumes a lot of APIs and services, and occasionally a non-critical one will go down (for maintenance, bugs, whatever) and we don't want our site to crash as well, since this was a problem... Read more >

Modeling Battleship in C# - Playing the Game

NOTE: This is the final part of a three-part series demonstrating how we might model the classic game Battleship as a C# program. Part 1 is over here. You might want to use the sample project over on GitHub to follow along with this post. Also, check out my other posts in the Modeling Practice series! With all the components and setup taken care of in the previous part of this series, it's now time to finish our system and... Read more >