C# Code Rules
ChristianFindlay.com
by Christian Findlay
2y ago
The C# Compiler’s name is Roslyn. Roslyn has a very large set of analyzers to check the quality of your code, but you must turn these analyzers on before they start doing anything. This post gives you some quick information on why it’s important to turn these analyzers on in your C# projects, how to do that, and how to configure them. What Are Code Rules? Code rules are rules that the compiler or code analysis tool enforces at the build level. They enforce Coding Conventions, detect mistakes, and provide the tooling to do bulk fixes. Roslyn and other .NET/C# tools use Static Code Ana ..read more
Visit website
Performance Vs. Scalability
ChristianFindlay.com
by Christian Findlay
2y ago
Performance and scalability are two related but separate aspects of a system. However, there is a lot of confusion around the two terms, which often leads to architectural mistakes. This article talks about the difference between the two concepts and how to improve them. Performance Performance is about how fast your system works. It’s the experience users have when waiting for your system to do something, and it’s how fast your underlying code runs. Network latency, bandwidth, and other factors also affect performance.  When the system does not have a lot of data or users, performan ..read more
Visit website
How to Upgrade a Codebase from .NET Framework to .NET 6
ChristianFindlay.com
by Christian Findlay
2y ago
You’re probably here because your business has a legacy codebase, and you need to upgrade it. You’re not alone, and almost every business goes through a similar thing at some stage. This post is part guide and part food for thought. Here, the focus is on upgrading a back-end from ASP.NET to ASP .NET Core, but you will find this helpful if you need to upgrade any code from Framework to .NET 6. You may want to break your architecture up into Microservices, or you may want to consolidate microservices back into a single service. You may want to upgrade your WPF app to WPF on .NET 6. Whatever your ..read more
Visit website
Podcast: Bartosz Adamczewski – Surprising .NET Performance
ChristianFindlay.com
by Christian Findlay
2y ago
About Bartosz: Developer with 15+ experience so far, trying to solve complex problems using various languages, tools, and platforms. Concurrency and Parallelism were my primary research area, where I was building Lock-Free and Wait-Free data structures as well as low contention locks. This podcast focuses on the surprising nature of .NET performance. Check out Bartosz’s infographics on .NET performance and his blog ..read more
Visit website
How to Stop NullReferenceExceptions in .NET: Implementing Nullable Reference Types
ChristianFindlay.com
by Christian Findlay
2y ago
This article gives you a toolset for stopping NullReferenceExceptions in .NET code. The article centers around Nullable Reference Types (NRT), a feature that Microsoft added in C# 8. This article mentions five additional tools to ensure that users will never encounter the exception and explains how to implement them in your code. The Toolset Use non-nullable variables (Reference and value types): flag variables that should never be null Null object pattern: inject default implementations with null behavior instead of null references Treat NRT warnings as errors: enforce the NRT ..read more
Visit website
Protected: How to Stop NullReferenceExceptions in .NET: Implementing Nullable Reference Types
ChristianFindlay.com
by Christian Findlay
2y ago
This content is password protected. To view it please enter your password below: Password ..read more
Visit website
RestClient.Net 5
ChristianFindlay.com
by Christian Findlay
3y ago
RestClient.Net makes HTTP calls in .NET easy. Send the request body as a strongly typed object, and get back a strongly typed object. You can inject the abstraction into your service classes and quickly mock them without worrying about the HTTP plumbing or converting to JSON. RestClient.Net 5 is a much improved, battle-hardened version that builds on the approach of V4 while introducing immutable types and a fluent API. It reduces the chance of shooting yourself in the foot with HttpClient, plays nicely with dependency injection, integrates with Polly, and the design should be familiar and com ..read more
Visit website
How To Change the Behavior of a C# Record Constructor
ChristianFindlay.com
by Christian Findlay
3y ago
Records are a new feature in C# 9. Records are special classes that borrow from Structs in that they have value-based equality. You could look at them as a hybrid between the two categories of types. They are more or less immutable by default and have syntax sugar to make declaration easier and more concise. However, the syntax sugar can obscure more standard tasks like changing the behavior of the default constructor. You will probably need to do this for validation in some cases. This article shows you how to achieve this. Take this simple example class: View this gist on ..read more
Visit website
Protected: Test- Oriented Development
ChristianFindlay.com
by Christian Findlay
3y ago
This content is password protected. To view it please enter your password below: Password ..read more
Visit website
Protected: How to Stop NullReferenceExceptions in .NET: Implementing Nullable Reference Types
ChristianFindlay.com
by Christian Findlay
3y ago
This content is password protected. To view it please enter your password below: Password ..read more
Visit website

Follow ChristianFindlay.com on FeedSpot

Continue with Google
Continue with Apple
OR