The Widgets paging example can page and filter. Let's take it a step further and add the ability to order by columns as well.…
read more...Creating Random Demo Data with Faker
In my last post, I outlined how I setup seed data for an ASP.NET application. Making it easier to create and re-create the initial state for my application data. Now let's take that a step further and use the Faker.Net library to created lots and lots of demo data to help develop the application.…
read more...Creating Seed Data for ASP.NET Applications
Easily create repeatable seed data for starting your ASP.NET Core applications using dedicated seed data services and custom arguments to dotnet run.…
read more...Custom .NET Project Templates
Share project conventions and code across teams and project using .NET custom project templates…
read more...Clean Startup in ASP.NET Core
Keep your Startup.cs file clean and tidy by using IServiceCollection and IApplicationBuilder extension methods…
read more...ASP.NET Pagination View Component
Easily implement paging in ASP.NET Core using a custom Pagination View Component…
read more...File Storage Providers for .NET
C# Reusable File Storage Provider for working with Local or Amazon S3 files.…
read more...Random String Generation in C#
Generate unique and random strings in C# quickly and easily.…
read more...AutoFocus in ASP.Net RazorPages
Using 'setSelectionRange' to autofocus on input elements in ASP.Net Razor Pages…
read more...Setting ASP.Net Cookies in Middleware
ASP.Net cookies can not be set after the response has started. Instead of simple before and after middleware take advantage of the HttpResponse.OnStarting method.…
read more...Better than HttpContext.Items
Old .Net programmers can learn new tricks. How to replace HttpContext.Items with Scoped Services.…
read more...Replacing C# DateTime with NodaTime
A recent client project was starting to feel like water torture. It seemed like every day we were finding another date and time bug in our software. As an experienced software developer, this was infuriating for a couple of reasons: In all my years I had never been on a project with the number of issues we were having I felt I should simply be better than this For crying out loud it's 2017 and we're still having time zone issues! Rules of Thumb After having a good pity party I reviewed my standard time handling rules Store everything in…
read more...Bootstrapping ASP.NET Core - Week 4
Adding ASP.NET Core Identity to an Existing Project Most of the existing documentation for ASP.NET Identity start with selecting “individual user accounts” when creating a new ASP.NET Core project. We already have a project so we need to look at adding ASP.NET Core to an existing project. Identity Overview What is ASP.NET Core Identity? ASP.NET Core Identity is the membership system for building ASP.NET Core web applications, including membership, login, and user data. - msft There are four main components that are used to make up the ASP.NET Core Identity system that…
read more...Bootstrapping ASP.NET Core - Week 3
In Part 2 of our series, we used Swagger to define a simple REST API for our dog walking application. In this installment, we are going to use Entity Framework Core to work with a database from our ASP.NET Core application. What is Entity Framework Core? Entity Framework Core is an object-relational mapper (O/RM) that enables .NET developers to work with a database using .NET objects. It eliminates the need for most of the data-access code that developers usually need to write - MSFT documentation Like ASP.NET Core, EF Core is a rewrite of the previous version…
read more...Bootstrapping ASP.NET Core - Week 2
Creating a REST API with MVC and Swagger In our last post we navigated around an empty ASP.NET Core application. This week we are going to start adding familiar MVC and WebAPI style routes and controllers. Along the way we will compare the starter template to the project we are building from scratch creating and discover how Swagger can help us easily document our REST API. We will also dig into ASP.NET Core configuration options and managing different environments in our application. Code is here: https://github.com/hansonio/fido/tree/part2 Demo application is here: http://walkfido.…
read more...