Latest Posts On Code Maze

Execute a PowerShell Script in C#

Execute a PowerShell Script in C#

In this article, we’ll learn how to execute a PowerShell script in C# using the ProcessStartInfo class from System.Diagnostics namespace and PowerShell classes from the System.Management.Automation namespace, which is available in PowerShell.SDK. There has been a lot of recent...

How to Get Class Name as String in C#

How to Get Class Name as String in C#

In our programming journey, there are times when we might find ourselves in a situation where we need to obtain the class name as a string. This proves beneficial for many reasons, such as logging, debugging, or other programming endeavors. In C#, there are different...

How to Add a Global Route Prefix in ASP.NET Core

How to Add a Global Route Prefix in ASP.NET Core

In this article, we will learn how to add a global route prefix in ASP.NET Core. This enables us to effortlessly incorporate the route prefix into our application's routing mechanism, offering greater flexibility and control. If you're into security, you're 100% familiar with Cross-Site Request Forgery...

Managed vs Unmanaged Code (Garbage Collection) in C#

Managed vs Unmanaged Code (Garbage Collection) in C#

Managed and unmanaged code are two types of code that differ in how they handle memory management. In this article, we'll explore the differences between managed and unmanaged code, focusing on garbage collection. Blazor Server and Blazor WebAssembly often...