Systems | Development | Analytics | API | Testing

.NET

How C# Reflection Works With Code Examples

To write code that can read, examine and even write code in runtime. Sounds like magic? Welcome to the world of C# reflection. Being able to write code that can examine and modify other pieces of code dynamically is quite a useful power. That’s what we call reflection, and in this post, you’ll learn how C# reflection works. We’ll open the post by covering some fundamentals. What is reflection in C#? Why do people use it? We’ll break all that down for you in plain English.

How to Use LoggerFactory and Microsoft.Extensions.Logging for .NET Core Logging With C#

Do you use.NET (formerly.NET Core)? If so, you’re probably familiar with the built-in.NET Core LoggerFactory which is in Microsoft.Extensions.Logging. Back when it was introduced, it created a lot of confusion around logging with ASP.NET Core. Several years latter, the dust has settled down, and.NET logging has become somewhat “boring”, which means predictable and consistent. In this post, we’ll offer you a guide on.NET logging.

.Net Core Dependency Injection

Dependency Injection (DI) is a pattern that can help developers decouple the different pieces of their applications. It provides a mechanism for the construction of dependency graphs independent of the class definitions. Throughout this article, I will be focusing on constructor injection where dependencies are provided to consumers through their constructors.

OOP Concepts in C#: Code Examples and How to Create a Class

Object-oriented programming (OOP) is a paradigm (a sort of “style”) of programming that revolves around objects communicating with each other, as opposed to functions operating on data structures. C# is the flagship language of the.NET ecosystem. Despite being a multi-paradigm language, its forte is certainly OOP. OOP is a recognized programming paradigm, but programming languages differ in how they interpret and implement its tenants.

The Ultimate List of C# Tools: IDEs, Profilers, Automation Tools, and More

C# is a widely used programming language in enterprises, especially for those that are heavily Microsoft-dependent. This language comprises a lot of tools with individual strengths. Here, we list C# tools for IDEs, profilers, automation tools, and more. If you build apps using C#, you most likely use Visual Studio and have explored some of its extensions to supercharge your development. However, this list of C# tools might just change the way you write C# code for good.

Best Practices for Error Handling in ASP.NET MVC

How easy would our lives be, as programmers, if our applications behaved correctly 100% of the time? Unfortunately, that’s not the case: things go wrong, often in serious ways. In order to offer the user the best possible experience—and also understand what went wrong so you can fix it—your application needs to handle its errors, and that’s why error handling is an important part of any application.

How to Catch All Exceptions in C# & Find All Application Errors

Exception handling is a critical component of every software application. The last thing you want your users to see is errors, or even worse, your application crashing. In this article, we will discuss how to find and catch all exceptions in C# applications. .NET provides several different ways to catch exceptions and view unhandled exceptions. Topics in this article.

How to transform Rollbar payload in .NET Core 7

Using Rollbar is great for Exceptions both handled and unhandled. But there is so much more you can get out of a solution like Rollbar. We often hear users asking us to log structured log data to Rollbar or that they have a custom JSon object that they would like to store in Rollbar. If you just send in the Json object using Rollbar.Info(YOUROBJECT) you will find that it is placed in the message body as a string. This is fine but we can do a lot better.

Building a RESTful Minimal API with .NET Core 7

.NET Core and ASP.NET Core are popular frameworks for creating powerful RESTful APIs. In this tutorial, we will use it to develop a simple Minimal API that simulates a credit score rating. Minimal APIs provide a streamlined approach to creating high-performing HTTP APIs using ASP.NET Core. They allow you to construct complete REST endpoints with minimal setup and code easily.