Posts
Why you should learn ASP.NET Core
Introduction A bit of History I have been surprised by the fact that so many people are not aware of Microsoft’s open source shift over last 5 (and maybe few more) years. Lots of people are not aware of current state of .NET, .NET Core and ASP.NET Core. And I do not blame them, they have been occupied by some other responsibilities or technologies.
EntityFramework Core - Add an implementation of IDesignTimeDbContextFactory - Multiple DbContext's
Introduction We already talked about problem when Entity Framework Core tooling requires you to implement IDesignTimeDbContextFactory - check out this post. It gets interesting when you have more than one DbContext in your application and you want to add another implementation of IDesignTimeDbContextFactory, without repeating the code and making sure that EF Core tooling picks the right one.
Entity Framework Core Generic Repository
Introduction Entity Framework Core Generic Repository - Behold! The topic that some people will frown upon. They don’t even wanna talk about it. However, others love it, they feel all excited on the mention of generic repository pattern.
ASP.NET Core Configuration - Reloading, Binding, Injecting
Introduction In the last post, we talked about ASP.NET Core Configuration in general. We saw how is it set up by default from ASP.NET Core. We also talked about sources and that order matters. This time we will talk about mapping configuration to classes.
ASP.NET Core Configuration
Introduction ASP.NET Core configuration differs greatly from standard ASP.NET. Instead of web.config or any other way to set up the configuration we use built-in Configuration framework that comes with ASP.NET Core. It is still key-value pairs collection at the end, but we can obtain those values from various sources. One of default sources is appsettings.json file that comes with all templates. ASP.NET Core 2 templates have configuration already filled with values from appsettings.json file, along with few other sources. However, we can use and combine various sources for configuration settings (values):
nameof expression is amazing! Say NO to magic strings!
The nameof expression This is one of many goodies that came with C# 6.0. That was back in July 2015. I have been using nameoffor quite a while now, but at the start, I wasn’t really aware of its full potential! Oh, what a sinner!
Google Analytics Tag Helper Component
Introduction In the last post, we talked about Tag Helper Components and how we can use them to modify existing HTML elements and inject scripts on the fly. I needed Google Analytics scripts in my ASP.NET Core application, so I decided to make a NuGet package for that.
ASP.NET Core MVC - Tag Helper Components
Tag Helper Components - Introduction We already talked about Tag Helpers in several posts before. This time we will be talking about something related. ASP.NET Core 2 is here and it brings us a new feature - Tag Helper Components.
EntityFramework Core - Add an implementation of IDesignTimeDbContextFactory
Problem Your DbContext in a separate project - class library project. You are trying to add new migration and update database, and you are running into this error: Unable to create an object of type ‘CodingBlastDbContext’. Add an implementation of ‘IDesignTimeDbContextFactory’ to the project, or see https://go.microsoft.com/fwlink/?linkid=851728 for additional patterns supported at design time.
ASP.NET Core - Best practices (tips and tricks) - an opinionated approach - Part 2
Introduction In the last post, we talked about tips and tricks, different strategies and approaches to make your code and project easier to maintain. This post is the second part in the series. Avoid HTML Helpers - Use Tag Helpers We should avoid using HTML Helpers in favour of Tag Helpers.