If you are old enough to have experience in .net framework (and I hope you do, otherwise I will feel really old myself!), there is a high probability that you were concatenating directory paths wrong all the time! And that’s all because some time ago, somebody at Microsoft had, let’s say, not a best idea :P.Continue Reading
[C#] How to read an API date field as UTC?
Dealing with dates in different time zones is a thing that requires some attention 😉. Today I want to show you a quick trick you should make when reading a date. And by that, I mean getting the date from an external source (ex. some IoT stuff or a REST API).Continue Reading
Lifehacks for working with big databases
Working with big databases, consisting of many, many tables (like hundreds or thousands), can be really painful. Recently, this happened to me and I discovered 2 life-hacks that help me survive this hard days.Continue Reading
How to turn on C# 8 Nullable Reference Types
Nullable reference types? What’s that?
The hottest novelty of C# 8 is almost as hot as gossips about Bradley Cooper and Lady Gaga affair… Or maybe nullable reference types are hotter? Hard to say. Never mind, I wrote about it once when everything was just an assumption. Now, we finally can turn this feature on and dive into some details 😊.Continue Reading
Cannot implicitly convert type ‘Abc<Derived>’ to ‘IAbc<Base>’ – Contravariance vs Covariance – part 2.
Today I will write about the way variance (<in T> and <out T>) influences type checking in C#. Yes, the fact that one type can be passed to a generic method that requires another type, depends on these 2 small keywords we write before ‘T’ (or whatever ?) in interface header. BTW this article is the continuation of my previous post that makes a dummy introduction to the variance – if you haven’t seen it, then you should :P. Not because I wrote anything important there, but because my google analytics statistics will grow. So as you can see – it’s worth it :P.Continue Reading
<in T> vs <out T> – Contravariance vs Covariance – (the easier) part 1.
Have you ever seen these mysterious ‘in’ and ‘out’ keywords in generic interfaces’ definitions? If so, you’ve probably already checked what it means, but if not… You better read this and the next post (I promise, I will write it soon, not like always :P). So today we will talk about the basics of variance in our own generic interfaces.Continue Reading
Entity Framework .AsNoTracking() – why & how (EF and EF Core)
AsNoTracking() is a powerful method from DbExtensions class. And for sure – the method you should know and use ?. Continue Reading
Application logs painkiller – Stack Trace Explorer
Reading application’s logs is not a big fun but let’s be honest – it is part of our job and we will not avoid it. So why don’t we make it slightly more pleasant?
Stack traces explorers to the rescue! Continue Reading
Imagine there’s no… NullReferenceException! (C# 8 plans)
Well, maybe not a totally ‘no’ NullReferenceException, but a whole lot less than now. Well, yeah, I had to catch your attention somehow :P. But anyway, have you heard those rumors about C# 8, how amazing it is going to be and how hard Microsoft is working on the release…? If not, you definitely should read this post! Because the promised changes sound really good and will be a must-to-know quite soon.
So today I wanted to write about one of the “louder” planned features – nullable reference types. Yes, you read it right. And yes, all the reference types we already have in C# are actually… nullable. Yeah, makes no sense, yeah, what a bullsh… No! Wait! Continue Reading
C# stuff nobody told you – delegate is a class! And there is a good reason for that!
Have you ever wondered why blue screens of death happen so rarely, nowadays? Of course, we can thank Microsoft for this but the way they fixed this problem is not so obvious! According to Marino Posadas (and his book Mastering C# and .Net Framework) back in 2010, Microsoft made an analysis of this topic and they came to the conclusion that the 90% (wow!) of the blue screens were caused by drivers! So, Microsoft made manufacturers to follow the Hardware Compatibility List. That somehow solved most of the problem but what with the rest 10%? Most of them was due to the… Continue Reading