236 Posts

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

Angular has built-in mechanisms for dealing with unhandled exceptions. In an application, we only need to provide this handler when we want to customize the display and handling of errors.

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

While I was working through my post regarding generically formatting Angular data within a component, another generic implementation that I needed arose. I needed a way to, in a very generic fashion, raise events from a child component to its parent. Within the context of an Angular table, this could typically coincide with a click event that needs to take action, or apply some logic, to the child’s bound data. Event Emitters in Angular readily facilitate this type of functionality.

More Link