Latest Posts On Code Maze

How to Show the Generated SQL Query in EF Core

How to Show the Generated SQL Query in EF Core

Entity Framework Core has many useful features, and in this article, we will see how to use it to show a generated SQL query. EF Core is an open source Object-relational mapper that supports several databases like SQLite, PostgreSQL, MySQL, and also LINQ (Language...

How to Build a URL Shortener in .NET Applications

How to Build a URL Shortener in .NET Applications

When working with URLs in our applications, there are times when they may become too long, clunky, unreadable, and difficult to use. In such situations, we can employ a URL shortener to make them shorter, more readable, and easier to share. Essentially, a URL...

Code Maze Weekly #210

Code Maze Weekly #210

Issue #210 of the Code Maze weekly. Check out what's new this week and enjoy the read. .NET and C# Top Picks Computing code coverage for a .NET project [www.meziantou.net] Computing code coverage without any dependencies is now possible in .NET. Check this article by...

How to Check the Total Number of Items Defined in an Enum

How to Check the Total Number of Items Defined in an Enum

In this article, we talk about enums and, more specifically, how to find the total number of items defined in the enum. But first of all, let's define an enum. Let's go over the basics and see which constructors we have available in C# with Aram Tchekrekjian. Can you...

How to Test gRPC Services in ASP.NET Core

How to Test gRPC Services in ASP.NET Core

gRPC is a popular way to create fast and scalable API's in the .NET world. In this article, we explore how to test gRPC Services in .NET applications, and set up both unit and integration tests to ensure the reliability and performance of gRPC services. [sc...

Restricting a Value Lifetime With the “scoped” Keyword in C#

Restricting a Value Lifetime With the “scoped” Keyword in C#

In this article, we will discuss the scoped keyword in C#, explore its use case, and examine how it can be advantageous. The contextual keyword scoped in C# serves as a powerful tool for restricting the lifetime of a value. Employing the scoped modifier allows us to...

How to Validate File Upload Extensions in ASP.NET Core

How to Validate File Upload Extensions in ASP.NET Core

In this article, we will see how we can validate file upload extensions and be certain that our applications are safe from malicious uploads. When receiving files uploaded by users, relying solely on file names to determine file types is risky. This is because we can...