I’m a web developer and this is my personal website.
If you’re interested in working with me then feel free to send me an e-mail zbigniew@decoy.softdevpractice.softdevpractice.com
I mostly work with C#, ASP.NET Core, Entity Framework Core and T-SQL.
I’m a web developer and this is my personal website.
If you’re interested in working with me then feel free to send me an e-mail zbigniew@decoy.softdevpractice.softdevpractice.com
I mostly work with C#, ASP.NET Core, Entity Framework Core and T-SQL.
The big idea with static code analysis is that we can analyse source code of our application to detect some kind of errors or issues (e.g. potential null reference). We can also analyse our source in terms of code quality metrics (e.g. method with too many parameters). It should, in general, let us have an overview of what’s happening in our code base (especially important with big code bases) and we can also use it to enforce certain code standards. Nowadays you will most likely integrate it with your CI pipeline to detect issues as soon as possible. ...
Many-To-Many relationship in not as straightforward as other relationships. In this post I’ll show you how to create many-to-many relationships and how to use them in EF Core. The model Simple and practical example of many-to-many could be some sort of digital ecommerce store. Users can put items into shopping cart (one shopping cart can have many items), whereas items belong to multiple carts. Lets start off by creating Cart and Item classes. ...
C# Enumerable.Range function generates sequence of numbers. This article explores details of the Range function as well as its use cases. Enumerable.Range overview It takes two arguments. First argument is the first number in sequence (e.g. 10, means that the first number in sequence is 10). Second argument is the number of items in sequence (e.g. 11 means that it will return 11 numbers). It returns IEnumerable<int> which contains generated sequence. Keep in mind that each subsequent number is incremented by 1, which also means that it’s in ascending order. This however can be changed with some Linq tricks (check examples below). ...
You probably already know how to localize regular classes in ASP.NET Core web app. It’s rather easy, at least in terms of resource files. Sometimes however we use nested classes which requires special way of naming RESX files. As it turns out it is actually pretty easy to do. If you want the answer right away, then here it is. You have to use + sign in the name of your resource file (like this: OuterClass+NestedClass.en.resx). ...
This time I’m going to give a few quick tips for dictionaries in C#. Some basic points before we begin: Dictionary is an unordered data structure Dictionary maps keys to values Keys have to be unique Dictionary implements IEnumerable Let’s start by creating a simple dictionary with some data: 1 2 3 4 5 6 // e.g. name and birth date var people = new Dictionary<string, DateTime> { { "John", new DateTime(2000, 1, 1) }, { "Jane", new DateTime(2000, 1, 2) } }; Looping through dictionary is simple, since it implements IEnumerable all we have to do is to use foreach loop. Each dictionary item has Key and Value property: ...