Akos Nagy
Akos Nagy

Posts by author

Autofac support for AutoMapper

Autofac support for AutoMapper

Jun 27, 2019
I have been doing .NET development for quite a while now. Sometimes people ask me how is it possible that I still find it interesting. Well, the answer is easy: I'm super D.R.Y. If you are not familiar with the term, you should look it up, but it
The specification pattern and variance

The specification pattern and variance

Jun 25, 2019
In a previous post I described the specification pattern, its uses and benefits and also gave a pretty neat implementation. However, there was something that I didn't discuss: the variance aspect of the pattern. It is a very important aspect, but that post was long enough as it was — so
Trying the Azure SignalR service

Trying the Azure SignalR service

Jun 14, 2019
Totally unexpectedly I ran into something "new" in Azure: the Azure SignalR service. It's been out there for a while, but somehow I haven't come across it (to be fair, it is now one of the better-marketed services of Azure). According to the documentation, it gives you a lot of
Default interface implementation in C# 8

Default interface implementation in C# 8

Jun 12, 2019
A while back the preview version of the last big feature of C# 8 came out: default interface implementation. To be honest, I'm not really a fan of this new option and I have been pretty busy, so I didn't really have the time to check it out, nor did
Duplex service over TCP with WCF

Duplex service over TCP with WCF

May 27, 2019
I was asked by one of my clients that I consult for to help with a TCP-based duplex communicaton solution using WCF. It's been a while since I have blogged about WCF (actually, it's been a while since I have used it), so I though it might make a good
A Visual Studio extension to really clean your projects

A Visual Studio extension to really clean your projects

May 10, 2019
A while back one of the participants at one of my C# courses asked me if there was a way to really clean your projects: that is, delete the bin and obj folders. Because I think we all know that the "clean project" option of Visual Studio does none of
Cosmos DB SDK v3 preview

Cosmos DB SDK v3 preview

Apr 17, 2019
A while back I reviewed the EF Core Cosmos DB provider preview. But that's not the only big change coming to Cosmos DB. The actual SDK that allows you access to all the features of the service is also getting an update. While I think it's still a couple of
Updating my extensions for Visual Studio 2019

Updating my extensions for Visual Studio 2019

Apr 8, 2019
Last week, Visual Studio 2019 was finally released and with that, I think (I hope) most of us will switch to a new IDE with a lots of cool features. And with that in mind, I sat down and upgraded my extensions in the Visual Studio Marketplace to support the
C# 8.0 in Visual Studio 2019: what's new

C# 8.0 in Visual Studio 2019: what's new

Apr 6, 2019
This week VS 2019 finally came out and I was going to write a very enthusiastic and very long post about the new language features of C# 8 that I was hoping would also premier with the new IDE. Well, I was wrong on all counts: no new language version,
Visual Studio extension to manage your Github gists

Visual Studio extension to manage your Github gists

Mar 20, 2019
There are a couple of extensions available in the Visual Studio Marketplace to handle your Github gists — and not to belittle others, but I have to admit, I didn't like any of them. They are not intuitive or comfortable to use or lack features. What I wanted was a complete,
Countdown to C# 8: Range and Index

Countdown to C# 8: Range and Index

Mar 18, 2019
In my previos post, I discussed one of the new features of C# 8: non-nullable reference types. That feature has been out for a while, so I think most of what can be said has already been said. But this time, I'm taking a look at something even newer: the
Implementing the IFormatter interface

Implementing the IFormatter interface

Feb 28, 2019
One of the courses I teach is the standard Microsoft 70-483 exam preparation course. For some reason, the exam still has questions about how the BinaryFormatter and SoapFormatter components work (I'm not even going to try to guess why), so the training material also discusses the related concepts in detail.
Awesome Northwind

Awesome Northwind

Feb 5, 2019
Whenever I give a talk at a meetup or teach at a course or just want to try a demo about a data driven technology, my biggest problem (and the biggest nag) is always to get some real(istic) sample data. Thankfully there are sample databases available on the internet
Updating the LinqPad CosmosDB datacontext driver

Updating the LinqPad CosmosDB datacontext driver

Jan 16, 2019
A while back I've created a data context driver for LinqPad so you can connect to your Azure CosmosDB databases as well. I'm very happy to see that it has caught on and a lot of you have at least downloaded it (and hopfully you are using it as well)
Repository and unit of work ARE useful

Repository and unit of work ARE useful

Nov 20, 2018
The repository and unit of work design patterns are useful. This is a statement that I can get behind in any debate when this topic comes up. Don't worry, I'm not dogmatic, I have a couple of really good arguments (IMHO) as to why. But I'm very tired of having
Memento design pattern done (almost) right

Memento design pattern done (almost) right

Nov 13, 2018
I regularly teach courses on basic object-oriented design patterns. Over the years I have come to realize that not every pattern is equally useful or equally well-thought out. One of the most common examples of patterns that have become more like anti-patterns over the years is the Singleton pattern. But
Next level serverless apps with Azure Blobs

Next level serverless apps with Azure Blobs

Nov 6, 2018
I've always been a huge advocate for (and fan of :) ) serverless apps. People often misjudge the concept: serverless doesn't mean that there is no server. I mean, what else would serve requests for the relatively primitive client side? There is a server. Maybe there is even a web server like
Updating the blog - again

Updating the blog - again

Oct 8, 2018
A while back I wrote a post about how I had upgraded the blog during the summer vacation with new features. Most of these were actual features, like the search function on the sidebar or the new tags page. I also told you to stay tuned, because more were coming
Dependency Injection Toolset upgrade

Dependency Injection Toolset upgrade

Oct 1, 2018
I have a little tool in the VS Marketplace called Dependency Injection Toolset. The idea behind the tool was to help developers who apply dependency injection regularly by making it easier to code constructor injection. The original version of the tool basically did two things: * Could generate a constructor for
Upgrading the blog

Upgrading the blog

Sep 24, 2018
It's been a while since I last posted on the blog. The summer was long and I spent more time in natural light :) But now I'm back with a renewed resolve. And I wasn't just lying around all summer — I did some upgrades to the blog itself. HTTPS using Let's
Deserialize into interface

Deserialize into interface

Jun 12, 2018
Not long ago I was teaching a Programming in C# exam prep course. One of the modules involved serialization and a student asked me a question that was quite intriguing: Given the serialized form of an object, is it possible to deserialize it into an object if we only have
Dependency injection toolset upgrade

Dependency injection toolset upgrade

May 21, 2018
Dependency injection is probably the best thing in software development since slide bread. I often blog about related things and I also have a Visual Studio extension to help those who apply the principles in practice. Guard clauses in constructors An important piece of best-practice is that whenever you use
What's new in C# 7.3?

What's new in C# 7.3?

May 14, 2018
C# 7.3 came out not long ago. I just had the time to do the update, so I thought I would do a post on it. There are a lot of other posts around about the same topic, but whatever. At least I can present this from my point
Adding logging using Mono.Cecil

Adding logging using Mono.Cecil

May 5, 2018
A while back (actually, it's been a long while) I found an interesting question on Stackoverflow. The question was about adding logging to method calls automatically. Or to rephrase: the question was basically about handling aspect-oriented programming using Mono.Cecil in .NET. So given this piece of code: public class
Visual Studio icon font

Visual Studio icon font

May 2, 2018
As you can probably see from my blog posts, I'm not really a front-end guy. If push comes to shove, I can manage some basic css, js and html but it's not really my thing. But sometimes, push does come to shove. As I was building the little promo website
Using Cognitive Services from Excel via PowerQuery

Using Cognitive Services from Excel via PowerQuery

Apr 25, 2018
I have a client that I regularly consult with about various .NET application development tasks. One time they were describing me a particular piece of software that supports product logistics. One part of the process is that products are basically assembled on a conveyor belt. They also showed me the
Throwback Thursday: Typed SQL reader

Throwback Thursday: Typed SQL reader

Apr 19, 2018
I've found an old HDD of mine and I got curious: what's on it? I had an old 3,5" HDD to USB adapter lying around and to my surprise, it was still working :) So I put the HDD in it, connected it to my 21st century notebook (actually, the
Code snippet for databound properties in MVVM

Code snippet for databound properties in MVVM

Apr 15, 2018
As you can read in the last couple of posts (like this, or this), I've been working with WPF for the last couple of weeks. Not very fun. I'm doing mostly the VMs and that involves a lot of property change notifications. We use the MVVMLight toolkit for basic MVVM
Danger Zone: The dark side of C# 7 ref return

Danger Zone: The dark side of C# 7 ref return

Apr 8, 2018
C# 7.0 introduced the new feature of ref return and ref locals. I have to say, I wasn't sure about the actual usefulness of the feature, but with the recent additions of reference semantics with value types in C# 7.2 I do see how they can be useful,
dotNet Falcon update

dotNet Falcon update

Mar 26, 2018
You might have noticed that in the last few months I haven't put out as many posts as I usually do. Well, here's a post explaining why (or rather, trying to make some excuses). I am working on a couple of things (stay tuned for other awesome stuff coming your
Iterating through dictionaries the better way

Iterating through dictionaries the better way

Mar 24, 2018
Using the right collection type at the right place is a challenging task. In my experience, most people just use List most of the time, without thinking about other possibilities. Now that's not to say that these two are not a good choice for a
Adding bytes in C#

Adding bytes in C#

Nov 20, 2017
What happens if you run this little piece of code? More specifically, what's the type of the variable 'x'? byte b1=1; byte b2=1; var x=b1+b2; Console.WriteLine(x.GetType()); Well, if you guessed byte, you were wrong. This will actually result in an int. This was
Extending Linq2Objects GroupBy

Extending Linq2Objects GroupBy

Nov 15, 2017
GroupBy() is one of the most versatile and underrated Linq standard query operator there is. You probably know the "base" version, which takes in a single parameter in the form of an expression (actually, Func, but that's not the point): public static IEnumerable> GroupBy(this
Implementing interface with auto properties

Implementing interface with auto properties

Nov 10, 2017
A cool feature in VS2017: when implementing an interface, you can now use auto properties. Here's what I'm talking about: let's say you have an interface, and you have properties in it. Something like this: public interface IInterface { int MyProperty { get; set; } } Then, you want to implement this interface in
Danger zone: true, false or...

Danger zone: true, false or...

Nov 1, 2017
As an MCT I regularly teach courses of different levels. And I have to say, I love teaching — that's the most efficient way to learn :) A participant at one of my advanced courses brought me this little 'problem' (of course, this is not a 'real' line-of-business problem, just something to
Back to the basics: Overload resolution in C#

Back to the basics: Overload resolution in C#

Oct 21, 2017
During one of my courses, and interesting question came up. Let's say you have a class definition like this: public class Test { public void Method(T parameter) {} public void Method(int parameter) {} } // ... // Test object = new Test(); // object.Method(7); So, as you can probably guess, the question was about
StackOverflow adventures: Don't create non-clustered index for foreign keys with Entity Framework Code First

StackOverflow adventures: Don't create non-clustered index for foreign keys with Entity Framework Code First

Sep 20, 2017
I found an interesting question on stackoverflow: https://stackoverflow.com/questions/46212828/ef6-preventing-not-to-create-index-on-foreign-key OP wanted to find a way to disable index creation for foreign keys. I don't believe there is an easy way to do this; my mind turned right to custom SQL generators and scaffolders. Using custom SQL
StackOverflow adventures: Specifying default sort order in EF using query interceptors

StackOverflow adventures: Specifying default sort order in EF using query interceptors

Sep 17, 2017
During the summer weeks, I was a little less active on stackoverflow. But now that the weather is becoming less and less friendly, I've reactivated myself and come across this question: https://stackoverflow.com/questions/45999489/entity-framework-interceptor-default-sorting/46001440#46001440 So basically, OP wanted to find a way to automatically add
Restoring from BACPAC times out in SSMS

Restoring from BACPAC times out in SSMS

Sep 11, 2017
When moving databases from the cloud to on-premise (usually for some advanced 'hacking', performance-tuning or just experimenting), I often use the BACPAC format. It is basically a zip file that encapsulates the schema and the contents of a database. I can export it with SSMS, and then re-import it the
Want to become a meetup speaker? Here's what you need!

Want to become a meetup speaker? Here's what you need!

Aug 17, 2017
I'm not just a software engineer, I'm also a teacher of software engineering. I feel obligated to share my knowledge with anyone who's in need of it, and, in the process, furthering my own understanding of technology and software engineering. That's why I became and MCT, that's why I'm on
Encrypting data the easy way using Crypteron

Encrypting data the easy way using Crypteron

Aug 15, 2017
Story of my life: I'm in the middle of some logistics-project for a hospital or a moving company or a security firm or (God-forbid) the government. Specs have been finalized for months, the business model is implemented in EF, we have a test environment filled with test users and test
StackOverflow Adventures: Add custom info to Web API help page

StackOverflow Adventures: Add custom info to Web API help page

May 1, 2017
I like stackoverflow. It provides me a way to keep in touch with the community, meet other schools of thought and test my knowledge on occasion. I like the interesting problems and questions. Take this one for example: http://stackoverflow.com/questions/42691154/provide-documentation-for-asp-net-web-api-method-with-a-dynamic-query-string The question goes like this: I'm
Stealing time in SQL Server

Stealing time in SQL Server

Mar 20, 2017
Here's a question for you: what is the output of this simple script in T-SQL if I run it on SQL Server 2016 Developer Edition (or any other edition and any other version, for that matter): declare @t1 datetime='2017-03-20 12:46:37.000'; declare @t2 datetime='2017-03-20 12:46:
.NET Workbooks: 101 Linq samples

.NET Workbooks: 101 Linq samples

Mar 1, 2017
Just yesterday I did a post on something called Xamarin Workbooks. In the post I elaborate on how cool this is and how useful I think this tool will be during my classes. Ever since a thread in my brain-process has been working on finding cool new ideas to present
Auditing EF Code First Migrations

Auditing EF Code First Migrations

Feb 26, 2017
EF Code First is awesome. I cannot emphasize enough how useful, intuitive and overall amazing it is (though I tried to do just that in this post, so I won't start it again). One problem that usually comes up against EF Code First is that you cannot handle changes of
Publish obfuscated and signed assemblies with ClickOnce

Publish obfuscated and signed assemblies with ClickOnce

Feb 19, 2017
Let me start off by saying: ClickOnce is not awesome. Or at least I think so. Unfortunately, when it comes to publishing thick-clients (yes, I still have to do that on occassion, like we used to in the 2000s), there is no good alternative. Everything else I know about has
Azure Automation Job for Index Maintenance

Azure Automation Job for Index Maintenance

Feb 14, 2017
Indices are good (yes, technically that is the plural form of index). They help you when you search for things - and that's mostly what databases are all about. But indices are only good if they are maintained. When you do your inserts and deletes, indices can become fragmented. (If
Adding custom parts to an xlsx workbook

Adding custom parts to an xlsx workbook

Feb 2, 2017
A while back I came across an interesting task. Basically there was an xml document which we used in one of our applications. It was a special resource file: the structure was maintained by us, but the contents were maintained by the customer. One day we decided that it would
Introducing dotnet Falcon

Introducing dotnet Falcon

Jan 16, 2017
Welcome, dear potential reader. I know you are probably busy, so I'll keep this short. Who am I? I am a software engineer, more specifically, a .NET software engineer. I specialize in back-end development and Azure. The other pieces of information are probably not so relevant, but just in case: