Category Archives: .NET

Blog posts relate the .NET ecosystem

.Net Core online courses

Published by:

.Net Core is a constantly growing ecosystem and it becomes a viable option for developers, mostly due to the fact that you can easily develop applications for any operating systems or any platforms. Learning .Net Core becomes more and more a very good investment. Especially for those who want to start learning now, C# and .Net is in my opinion one of the best ways to start. I already wrote an article that explains why I believe this, so I won’t dive in this topic in this occasion.

On the other hand I feel a deep sense of responsibility to give back and that’s why my mission is to help regular people with passion for technology to become software developers. That’s mostly because as a self-taught developer I am fully aware of the challenges that people with passion for software would face until they get the first software developer role. That’s precisely the reason why I have started Codewrinkles Academy! I won’t dwell on what’s making this learning platform great, because I already did it (so check it out!). Right now I want to announce that a .Net Core learning path is available for registration. And I want to talk about the courses, time to completion and possible outcomes. Continue reading

An overview of Razor Components (server-side Blazor)

Published by:

I wrote about Blazor some time ago. Blazor is really cool in my opinion and, in a certain way, the future of web development (even if not in the form we might think of nowadays). It is a single-page web app framework built on .NET Core that runs in the browser with WebAssembly. The overview I made earlier is still valid so you might check it out. In this article however I want to offer a quick overview of a feature called Razor Components or server-side Blazor. Continue reading

Playing around with ASP.Net Core ConfigureServices()

Published by:

These days I’m working on a small personal project with ASP.Net Core and this allowed me play around with the ConfigureServices method in Startup.cs and discover some things I wasn’t aware of. So I though on sharing my experiments here to see what others have to say about them.

Even if the application itself is fairly simple I decided to create several different projects in a solution to keep things open for extensions, right? So what I have is an ASP.Net Core API project and a bunch of different other projects like Sample.Core, Sample.Infrastructure, Sample.Dal. For the data access layer I wanted to play around with the repository pattern and created a very simple and insecure repository to handle operations on the Azure Table Storage service. Continue reading

How to integrate Ocelot with Identity Server 4

Published by:

Not so long ago I wrote an article on how we can create our own API gateways using the Ocelot open source library. Since then, I received some questions on how to integrate Ocelot with Identity Server 4 so I thought to share how I managed to achieve this using the Ocelot documentation and some basic Identity Server 4 knowledge. Please note that following these steps I was able to successfully build an API gateway using Ocelot, that used Identity Server 4 JWT tokens to authorize requests and redirect them to the desired downstream path. Continue reading

New Asp.Net Core 2.1 features announced at #MsBuild

Published by:

Last week #MsBuild was underway in Seattle. I have already made some notes on the keynote last Monday and the following days I tried to keep track with different novelties announced for ASP.Net Core 2.1. And I think for some members of the community it might be useful to have them written down, so in this article I’ll try to summarize all the information. Please note, that I was not present at the #MsBuild conference. I just tried to follow the sessions streamed on Channel 9 and some key Twitter accounts.

HttpClientFactory

One of the novelties I am most exciting about is the new HttpClientFactory feature. If you worked with the HttpClient in production software, there is a good chance that you noticed a lot of challenges and head aches. In a services oriented architecture where we might need to have several different connections, the only way to go is to use several HttpClient instances (sure not for every call a new client 🙂 but still a bunch of them).  One of the problems is that each HttpClient would maintain its own connection pool to the remote server, so it’s highly inefficient. The second, and most stringent problem, is that in scenarios where an application needs to make a lot of calls to remote servers, you could exhaust all the available sockets from time to time. And this is really not cool at all.  Continue reading

Microsoft Build 2018 keynote summary

Published by:

The Microsoft Build 2018 kicked off today in Seattle with Microsoft CEO Satya Nadella taking the stage and presenting Microsoft’s vision and strategy for the developer ecosystem. Scott Guthrie took then the audience through the main technical novelties with a lot of help from product managers and Microsoft partners or customers. If you missed the Microsoft Build 2018 keynote, here is a brief summary of what happened, taking note that it might be difficult to sum up in a few lines everything that was discussed for more than 3 hours.  Continue reading

Building your own ASP.Net Core API gateway with Ocelot

Published by:

I’m currently working on some very interesting stuff and one of it is building an Asp.Net Core API gateway. An API gateway might be a very useful part in a service oriented architecture using the micro services approach. In such an architecture you might have a lot of different APIs, each responsible only for one specific thing. Without an API gateway, consumers would need to send requests to each API and then aggregate the responses. An API gateway would do exactly this for the consumers (and many more of course) so that they would need to send only one request to one endpoint and the gateway would aggregate the needed response. Continue reading

The curious case of strings in C#

Published by:

In the last article I tried to describe the difference between value types and reference types in C# and I received some interesting feedback from colleagues and former colleagues as well. And based on discussions I had, it makes a lot of sense to talk a little bit about strings. Strings are very strange, because they are a reference type but behave somehow similar to value types. So, there are some common misconceptions and misunderstanding when it comes to strings that I will try to clarify in this article.

Note: I have also created a video on this topic. If you find it easier to follow the video, then here it is:

Continue reading

Reference types and value types in .NET

Published by:

In .NET (and therefore C#) there are two main sorts of type: reference types and value types! Understanding these sorts of type is crucial in the .Net ecosystem and, more generally, in object oriented programming. There are some clear definitions of these concepts that anybody could learn fairly easy, but really understanding how reference types and value types work is sometimes a little bit harder. And I must confess that it took me some time to achieve a certain level of familiarity. Furthermore, if you really want to understand how reference types and value types work, you need to get your hands dirty an play around with them. In this article I will try to explain reference types and value types as good as I can, starting from some dry (but important) definitions that I will try to make more vivid using code samples.

Note: I also made a YouTube video on this topic with some more graphical representations of these concepts. You might want to check it out:

Continue reading

Sorting lists in C#

Published by:

Working with lists is something developers do almost everyday. One of the most common tasks when we think about lists is sorting them. Fortunately, sorting lists in C# is not very complicated when it comes to primitive types and strings, but are slightly more complicated when we create lists of our own objects. In this tutorial we’ll go through some of the common ways to sort lists in C#.

Update: I have also created a video on this topic so if you think that it’s easier to follow the video, here it is:

Let’s start with a short and simple example. Let’s assume that we create a list of names and we add some names to the list:


List<string> names = new List<string>();
names.Add("John");
names.Add("Dan");
names.Add("Zack");
names.Add("Cristina");

Continue reading