Skip to main content

66 posts tagged with "Programming"

General Programming Concepts and Languages

View All Tags

How to Use Property Patterns in C#

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

An if chain that checks order.Quantity == 0, then order.Quantity > 10, then order.Price >= 20 repeats the object's name on every line. A property pattern says the same thing once per case, inside a switch expression or an is check, and the compiler warns you about cases that can never be reached.

How to Create a .NET C# Web API Solution with a Class Library

· 19 min read
Jagdish Kumawat
Founder @ Dewiride

A real .NET C# Web API usually isn't one project. It's a solution: the API itself, plus one or more class libraries for code that doesn't belong in the web layer, such as the database code. This guide builds that structure from the command line with .NET 10, adds the settings that production projects use, and fixes the two errors those settings raise on the template's own code.