There are a lot of different small points to remember about Asp.Net Core best practices. This post intends to summarize the most important points in a way that makes it easy to preuse quickly. This post does not try to be a comprehensive guide, but a quick reference for many different points that exist on …
Asp.Net Core
Security Best Practices: A Comprehensive Guide
In this article we’re going to go through some security best practices around the technologies that I’ve used over the years I’ve been working as a software developer. I’m going delve into multiple security topics related to different technology, but I’ll try to keep it in checklist format and short for it to be easier …
Integration Test In Asp.Net Core 6 Using SqlServer Image and TestContainers
This post is about writing integration tests and TestContainers. As you might know writing integration tests against the in-memory provider is a bad practice. Because it only works well with trivial solutions. Mostly because the in-memory API of IQueryProvider doesn’t match the LINQ query provider. Here’s a good article called “Avoid In-Memory Databases for Tests” …
How to mock APIs with Binary Responses using Postman Mock Server
There are different solutions for mocking an API endpoint. Such as using Microsoft Flow or doing it manually on a sever. But Postman mock servers can be a better fit if you already use Postman for your API development. Also, the initial use of their mock server is free with some limitations which I’m going …
Upgrade to Asp.Net Core From Asp.Net MVC 5
I’m working on a project written with Asp.Net MVC 5 were I work. We intend first upgrade our class libraries to .Net Standard as much as we can. Then we make the move to Asp.Net Core. But since we have many class libraries, I’ve decide to first do a little search about what is the …
.Net Core 3 New Json API And Its Features
Until the release of .Net Core 3, the Asp.Net Core was dependent on Json.NET for its serialization. But with release of .Net Core 3, this dependency is removed and a new API is created. Not only there is no dependency on Json.Net in .Net Core 3 but also this new API is much faster than …
Dependency Injection: Conditional Resolving of Multiple Implementation of Interface
Sometimes we need to resolve a dependency but not with one implementation, but with multiple. There are couple of scenarios that calls for conditional resolving of types. Such as when using a generic class and methods with a dependency on another class. Now imagine the aforementioned class is an abstract one, and we need to …
Build UI Tree With Recursive Asp.Net Core View Component
Previous version of Asp.Net MVC had the concept of local view helpers that could contain HTML too. You see an example of this here. But this feature is removed in Asp.Net Core, but we have a better tool to do it. There might be a lot of other replacement solution for using @helper, but in …
Using Task.WhenAny And Task.WhenAll
In this post, we’re going to see when we should use Task.WhenAny and Task.WhenAll. I’m also going to explain the differences between Task.WaitAny and Task.WaitAll. Then I move on to show some example of good and bad usage of these constructs. We’re also going to see some situations such as when we need immediate processing …