Category Archives: ASP.NET

Home / ASP.NET
121 Posts

Continuing my series on porting to .NET Core, I have mostly converted a production .NET 4.5.x applcation to .NET Core 2.2.  As I mentioned, there are lots of conversion points that are worth mentioning for anyone else endeavoring to modernize a .NET application.

More Link

Continuing my (old) series on porting to .NET Core, I am sharing some of my experiences of moving a production, legacy .NET 4.5.x application to .NET Core 2.2.  This was a interesting endeavor since the application itself had some really deep hooks into the older WebAPI/MVC pipeline.

Ripping out those hooks is like opening the proverbial can of worms ..

More Link

Earlier today, I was struggling a bit to get a .NET Core application’s authentication mechanism to behave appropriately for both MVC (view) and API (ajax/json) requests. In .NET Core 2.x, handling this is not as straight-forward as it could be, but it’s doable. Effectively, we want a user requesting a view through a normal browser request to get an authentication challenge / login page, but we want API requests to receive a 401 response and end it there. Under normal circumstances, though, both types of requests would receive the login page.

More Link

A while back, I blogged about using open generics with .NET Core Dependency Injection. It really does work great for an out of the box experience. However, one drawback is that you can’t use a factory pattern like you can when injecting in a type-specific way.

More Link

The other day, I wanted to create a really simple console application using .NET Core 2.x. Out of the box, however, it appeared that there were a lot of compromises to a console application as compared to a Web/Kestrel hosted app. The main things that were missing were dependency injection and user secrets.

More Link

Last night I was working on a project that had some many to many database relationships. On one side of the relationship, someone decided to use zero as the default “nothing selected” sort of key. This simply doesn’t work with Entity Framework, or probably most other .NET ORMs.

More Link

This morning I was updating some Data Models in a project, and noticed, based on my project scheme, that I would have to add a derived BaseRepository class. This is a side-effect of the way I’ve used Ninject for a long time and every IRepository<T> is specified to be a BaseRepository<T>. That pattern is a little annoying, and in some ways, is counter-intuitive when dealing with DI and generics.

More Link