Category: Software Development
-
C# Record Methods
C# .NET Core records can have methods. Records in C# were introduced in C# 9.0 as a feature for creating immutable reference types with value-like semantics. They are often used to represent data objects that primarily contain data without much behavior. However, despite being focused on data, records can still have methods, just like classes.…
-
TDD Test Driven Development
Test-Driven Development (TDD) is a software development approach where you write tests before writing the actual code that implements the functionality. The main goal of TDD is to ensure that your code is reliable, maintainable, and bug-free from the outset. Here’s an explanation of the main concepts and steps involved in TDD: Main Concepts of…
-
ORM Features
Object-Relational Mapping (ORM) frameworks provide a way to map objects in an application to relational database tables, allowing developers to interact with the database using high-level programming constructs rather than raw SQL queries. ORMs offer a variety of features that help manage the persistence of objects, optimize database interactions, and simplify development. Here are some…
-
Message Brokers and Large Messages
Handling large messages, such as videos or other sizable binary files, in a message broker system presents unique challenges. These challenges include ensuring efficient transmission, avoiding broker performance degradation, and managing storage effectively. Here are some best practices and strategies for handling large messages in message broker systems: 1. Use Message References Instead of Direct…
-
Message Broker functions
Message brokers are middleware solutions that facilitate the exchange of messages between distributed systems. They offer various advanced functions that enhance message processing, routing, and delivery, allowing for more flexible and efficient communication in complex architectures. Below are some of the advanced functions provided by message brokers, such as message filters, routing, and others: 1.…
-
REST Minimal Api with Authentication
Adding external authentication providers like Azure AD or Google to a .NET Core Minimal API involves integrating the appropriate authentication libraries and configuring the services to use these providers. Below is a modified version of the original code that adds external authentication using Azure AD and Google. Step 1: Install Required NuGet Packages First, you…
-
REST endpoints with .NET Core Minimal Api
Creating REST endpoints using .NET Core Minimal API is a streamlined approach to building web APIs with less boilerplate code. Below is an example of how to create several REST endpoints using .NET Core Minimal API. This example assumes you are working with a simple model, such as a Product, and provides endpoints for basic…
-
SQL for Business Logic
Writing business logic using SQL stored procedures and SQL functions can be an effective way to encapsulate complex logic within the database layer, which can improve performance, security, and maintainability. Below are explanations and examples of how to implement business logic using SQL stored procedures and SQL functions. 1. SQL Stored Procedures Description: Advantages: Examples:…
-
Defensive Programming
Defensive programming is a coding practice that involves writing software to function correctly under unforeseen conditions or when faced with unexpected input. The goal is to ensure that the software is robust, resilient, and able to handle errors gracefully, minimizing the risk of bugs and vulnerabilities. Below are some key principles of defensive programming, along…