Tag: C#
-
Where are the Authentication views in AspNet Core App?
I am struggling with Visual Studio for Mac. I have been a Visual Studio user since it came in multiple CDs in a box. Visual Studio has been improved a lot, I like it more now than I did before. But there is a problem, the VS version for the Mac is a completely different…
-
Don’t forget about character casing when comparing strings!
There are many issues I’ve experienced during the many, many years I’ve worked as a software developer. But one of the most recurring issues is, without a doubt, the mismatching of words due to character casing. There are solutions to the character casing mismatch problem. For example, you can make your strings all lower case…
-
Parallelism. Using Parallel.For and ConcurrentBag.
Parallelism refers to the technique of running multiple calculations at the same time to speed up a computer program. Historically, this has been a complicated thing to write requiring a developer to do complicated coding including low-level manipulation of threads and locks. A program will generally run faster if you allow it to execute multiple…
-
An introduction to Single Responsibility principle (SRP)
This is the fifth and last article describing SOLID principles. This article is about the Single Responsibility principle. Hopefully it will help you understand what the principle is all about and why it’s important to keep it in mind when designing and writing your code. What is the Single Responsibility principle? Here is the definition…
-
An introduction to Open Closed principle (OCP)
This is the fourth article on SOLID principles which I started a few weeks ago. I hope this is useful for you and that it gives you a simple understanding of what the Open/Closed principle is all about. What is the Open Closed principle? Bertrand Meyer coined the term Open/Closed Principle which appeared in his book…
-
An introduction to Liskov substitution principle (LSP)
This post is about the Liskov substitution principle (LSP). This is also the third of my posts about SOLID principles, following the posts I wrote about DI and ISP in the past few weeks. What is Liskov substitution principle (LSP)? This principle is based on Barbara Liskov’s definition of subtyping, commonly known as the Liskov substitution principle…
-
An introduction to Interface Segregation Principle (ISP)
Last week I wrote a post about Dependency Injection (DI) with some basic examples in C#. Today I would like to write and offer a simple example of what is known as Interface Segregation Principle (ISP) which can happen if you are not careful when using and implementing interfaces in your code. What is Interface…
-
An introduction to Dependency Injection (DI) and Inversion of Control (IoC)
There is so much confusion and arguing about what dependency injection is and whether is the same as inversion of control or just one form of it. If you are new to these terms it can be very confusing to say the least. I’ll try to describe what these are with some examples written in C# and…