Category: C#

  • Uploading Large files with Angular 14 and ASP.NET Core 6

    It’s been a bit since my last post, and it was mostly me trying to figure out what to talk about next. I thought this would be an interesting post. NOTE: the code for this blog can be found here. So, uploading large files directly from a web site can be a burden. If the […]

  • Tooling with Benchmark.NET – Entity Framework Core vs ADO.NET Part ][ – Multiple Inserts

    The previous post (here) left me wondering how slow Entity Framework Core was compared to ADO.NET. This post will be comparing performing 1k record inserts on both libraries. I’ve added the two benchmarks (using Benchmark.Net) to the code. Let’s have a look. (The code can be found here.) First, I’ll show the additions to the […]

  • Tooling with Benchmark.NET – Entity Framework Core vs ADO.NET

    Benchmark.NET is a “Powerful .NET Library for Benchmarking” (link to Github, here). Simply, decorate a function with the Benchmark attribute and run the system in release mode and it’ll calculate mean, error, standard deviation, median, and even memory used. So I thought I’d use it to do a few comparisons between Entity Framework Core 6 […]

  • ASP.NET 6 JWT Unauthorized Issue With Multiple Servers

    Not long ago, my company upgraded to .NET Core and had some random authorization issues. Our general architecture is a load balancer that feeds a few API’s. After a user got logged in, he would immediately get logged out… Randomly. This caused us to look at our login process. So, the user would login which […]

  • ASP.NET 6 and Dependency Injection

    From the beginning of the .NET Core era, Dependency Injection is to be used thoroughly. Controllers, Business Logic, and just about any other dependency can use Dependency Injection. So, what is it and how is it set up? (The source code for this project can be found on Github here.) What is Dependency Injection Dependency […]

  • Using RabbitMQ in ASP.NET Core 6.0

    Continuing from my last post, here, let’s add the ability for an ASP.NET endpoint to queue a message to RabbitMQ. The source code can be found on Github here, please use that as a reference. First thing to do is to add an ASP.NET Core project to the solution. Right-click on the solution and select […]

  • Using RabbitMQ in C#

    Often, when dealing with software, there are tasks which take long to compute. As such, you wouldn’t want to compute this directly in an API, but use other methods to calculate it and return it to the user at a later time. (Think generating a report, or dealing with large amounts of data.) Simply put, […]

  • Sorting in Entity Framework Core

    Continuing from my last post. Let’s add a few endpoints that support sorting. If you’d like the source code, it can be found here. First, I will add a PagingViewModel.cs file to the Database project: This contains the Start index and the Count (which is used for pagination). Also, it has an OrderBy string as […]

  • Tips and Tricks From a Senior C# Developer

    This blog is a bit different from my recent blogs. For this one, I’m assuming the reader already knows a bit of C# and Entity Framework. I’m going to discuss some do’s and do-not’s when communicating to a database. I will be using the source code from my first blog which is on Github here. […]

  • Keeping Windows Services Setup Simple with Topshelf and C#

    Windows services have been around a long time. Generally, they’re asynchronous programs that run in the background on a Windows machine. Setting up a Windows service can be tedious – that’s where Topshelf comes to the rescue. From their site (here): “Topshelf is an open source project for hosting services without friction. By referencing Topshelf, […]