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. We will also talk about various ways of injecting configuration settings […]
Continue readingIntroduction 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 […]
Continue readingIntroduction 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. It is actually a Tag Helper Component. […]
Continue readingProblem 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. […]
Continue readingIntroduction 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. Tag Helpers are […]
Continue reading