Author Archives: Dan Patrascu-Baba

About Dan Patrascu-Baba

,Net Developer. Focusing on both the .Net world and Microsoft Azure. Experienced speaker and trainer.

Data as a new global currency! Thoughts about machine learning and artificial intelligence

Published by:

This week I attended an artificial intelligence workshop organized by the company I work for and very nicely delivered by Richard Jarvis from DXC. Therefore, I think it would be nice to share some things I’ve learned there alongside with some personal thoughts on buzz words like, artificial intelligence and machine learning.

First of all there is a huge misconception that those who are not math geniuses should probably stay away from this topic. I learned during the workshop that this is simply not true. Sure, if you really want to dive deep into machine learning algorithms researches you need to know mathematics. Fortunately, the world won’t probably need as many researchers as people who are aware how things work and that are able to build applications and bring value to users by relying on the research that’s already been made. Why I say that? 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.


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 quest for a perfect IDaaS solution

Published by:

Every discussion about security should start with a discussion about identity and access management. It’s that important and therefore the quest for a perfect IDaaS solution is a painful but needed journey. One could of course choose to build its own identity and access management systems/software, but most of the time companies don’t have the necessary time and resources to do that since we’re seeing crazy release cycles nowadays. Going towards IDaaS is therefore a natural choice in a lot of circumstances. But do we really have a “perfect for every scenario” IDaaS solution somewhere out there? Let’s see! 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>();

Continue reading