Category Archives: C#

C# issues and solutions

Change notification chaining

Sometimes you want to define a complex container that aggregates other objects and you would like to chain INotifyPropertyChanged notifications upwards. However, it is difficult to write all the code to wrap up everything needed, and often results in code … Continue reading

Posted in .NET, C# | Tagged , , , , | Leave a comment

Naming items

From time to time I find projects with completely inconsistent naming for their items. While I believe naming things – be them source code files, variables, or enum values – is one of the most important things for the long … Continue reading

Posted in C# | Tagged , , , | Leave a comment

Reverse for

When one writes a for loop for ascending order it will probably be like this: for (int i = 0; i < count; i++) But what if you want to do it in reversed order? The first option would be: … Continue reading

Posted in C# | Tagged , , , | Leave a comment

Bridging

When you, a Microsoft technology-oriented developer, write software today you have to select the target platforms you would like to support. The platforms are then used to select the tools, technologies, and programming languages you can use for coding the different layers of … Continue reading

Posted in .NET, Architecture, C#, Development, JavaScript, Unity | Tagged , , , , | Leave a comment

IReadOnlyCollection instead of IEnumerable

Whenever you expose a service API, either internally to your team, or publicly in a framework, such as with an interface or simply in a method signature and you want the client to pass or receive a collection of objects you have … Continue reading

Posted in .NET, C# | Tagged , , , , , , , | 1 Comment

A single line after if shouldn’t require {braces}

I saw many C# style guidelines (or even enterprise standards) requiring that the code statements within of if (or else, or else if) clause should always require braces ({, }), even when there is a single statement to run. I feel … Continue reading

Posted in .NET, C# | Tagged , , , , | Leave a comment

Async-await

Every tutorial on async-await support of C# will state that they are helpers that work like this: an async method is just like ending with an operation completed event being raised; an await method call is just like registering an operation … Continue reading

Posted in .NET, C# | Tagged , , , , | Leave a comment