X

ASP.NET

Injecting services to ASP.NET Core controller actions

ASP.NET Core has thin but rich and powerful built-in dependency injection mechanism we can use to inject instances to controllers and some other parts of web applications. Although constructor injection is the most famous dependency injection method for controllers there is also dependency injection to controller actions available. This post introduces controller action injection and shows how to benefit from it.

Running ASP.NET Core application as Windows service

ASP.NET Core 2.1 introduces new application host for Windows services. We can now run ASP.NET Core applications as Windows services with minimal effort. This blog post introduces how it is done and how to build and run Windows services on ASP.NET Core without any need for dirty hacks.

Database level grouping in Entity Framework Core 2.1

Previous versions of Entity Framework Core doesn’t support database level grouping and LINQ GroupBy is translated locally. Entity Framework Core 2.1 translates LINQ GroupBy to database query in most of cases. Here is the example.

GDPR features in ASP.NET Core

As General Data Protection Regulation (GDPR) is now official in European Union (EU) there’s also some basic support for it included in ASP.NET Core 2.1. Althouhg it’s not possible to come out with technical etalon for GDPR there’s still some good starting points available in ASP.NET Core. Here is the brief overview.

Include for derived types in Entity Framework 2.1

When I wrote user interface for my TemperatureStation solution I faced some bad problems with Entity Framework Core when trying to query base type and get some navigation properties of derived types included. I was able to come out with some work-arounds that were far from being satisfying for me. Include for derived types in Entity Framework Core solves the problem.

Razor Class Library with ASP.NET Core MVC

ASP.NET Core 2.1 introduces Razor Class Library (RCL). It’s the new way how to share reusable web application components with UI as dependent project or NuGet package. As public examples mostly cover how it works with Razor Pages, I decided to write this blog post and demo application for ASP.NET Core MVC.

Effective bundling with ASP.NET MVC

Bundling and minification has been available in ASP.NET MVC for a long time. This blog post focuses on problems people have had with bundling and provides working solutions for those who cannot use bundling in ASP.NET MVC for different reasons. Also some ideas about more effective bundling are presented here.

Building confirm delete dialog on Blazor

Blazor supports communication with JavaScript using JavaScript interop. I used JavaScript interop in Blazor when building confirm delete dialog of my Blazor demo application. This blog post shows how to interact with JavaScript code from Blazor and how to build interactive dialogs.

Dependency injection in Blazor

Blazor supports dependency injection similar to what we have in ASP.NET Core. Also view injection is supported. This writing introduces dependency injection in Blazor and provides working code samples about it.

Building Blazor pager component

I had presentation for local community about Blazor and as a side-product I built something useful. Blazor supports components that are a little bit similar to ones we have in React.js. I took my previous work from my blog posts Paging with Entity Framework Core and Building Pager view component and built pager component for Blazor.