ASP.NET middleware

Middleware is a component in the app pipeline to perform some work on request and response, handing the modified request or response to the next middleware until the response is sent to the client.

Entity Framework many to many relationship using Fluent API

In Entity Framework you don't need to manually insert an entry into the join table. Even you don't need to define the join table in your setup. Whenever you add a new object to either of the tables via Entity Framework, it takes care of the rest.

.NET memory management

The summary and highlights of the book "Under the hood of .NET memory management" which I enjoyed reading it. Some of the contents might be outdated but I think it gives you a good understanding of how the languages memory management work.

Check variables value in RAM

If you want to check the value of a variable in your RAM, get the address of that variable using the following code:

Read Large Files in .NET

If the file we want to process from a network location is huge and doesn't fit in the memory, we can read just the header of the file and read the body as stream. We can either pass the HttpCompletionOption to the GetAsync method or use GetStreamAync method: