Smarter APIs with GraphQL

Programming

While REST is not going away anytime soon and remains perfectly suited for many use cases, GraphQL offers significant advantages for applications where flexibility, efficiency, and rapid development cycles are critical. By enabling more precise data fetching, reducing the number of network requests, and improving the overall developer experience, GraphQL is helping to shape the future of API development.

Follow this step by step guide to setup your first GraphQL Client and Server in C# with .NET!

Read more...

Handling Large Files: BufferedStream vs LINQ's Chunk method

Programming

The choice between using BufferedStream and the LINQ Chunk extension method for operating with very large files depends on your specific use case and requirements. Here we discuss the pros and cons for each.

Read more...

Using the Model Context Protocol (MCP) with C#

Information

With the new MCP C# SDK, developers can efficiently manage communication between AI models and applications. 

Anthropic’s Model Context Protocol (MCP) is currently making waves. It's a standardized protocol designed to streamline communication between applications and models by offering a structured way to exchange context and data between AI models and their clients.   Whether you're developing AI-powered applications or integrating multiple models into a cohesive system, MCP ensures interoperability and scalability.

Read more...

Locale Functions and Clean Code Principles

Programming

Local functions are methods of a type that are nested in another member. They can only be called from their containing member.  Local functions provide a clean way to organize code while potentially improving performance and maintaining better encapsulation.  Local functions should enhance readability and performance without violating Clean Code Principles.  If they make the code harder to understand or maintain, that's a sign they should be refactored into regular methods.

Read more...

C#

.NET object-oriented fluent SQL Builder

Programming

KnightMoves.SqlObjects is a .NET NuGet package that provides an object-oriented fluent SQL builder, allowing developers to construct SQL queries using C# objects instead of string manipulation, closely mirroring T-SQL syntax for a more intuitive experience.

Read more...

Random.Shared in .NET9

Programming

With .NET9 Microsoft introduced Random.Shared for for thread-safe random number generation.

Read more...

Check if a String is a Palindrome with LINQ

Programming

You can use the power of LINQ to solve problems in just a few lines of code instead of "inventing your own algorithms" - which will lead to much cleaner code.  Let's examine for example on how to check for palindromes.

Read more...

Simplifying Dependency Injection

Programming

Dependency Injection (DI) is a cornerstone of modern .NET applications, ensuring loose coupling, testability, and maintainability. However, traditional DI configurations can quickly become verbose and boilerplate-heavy. Developers often find themselves manually registering every service, leading to cluttered Program.cs files and a tedious onboarding experience. Campsis.AutoInject comes to the rescue!

Read more...

Fluent Builder Pattern in C#

Programming

The Fluent Builder pattern is a powerful tool in your C# toolbox. When implemented correctly, it can significantly improve the readability and maintainability of your code.

Read more...

C#

Understanding Memory<T>

Programming

Modern applications often require handling large datasets efficiently without unnecessary data copying. C# introduced Memory<T> as a versatile tool for optimizing memory management. Here we will explore how Memory<T> solves common issues and its advantages over traditional approaches.

Read more...

C#