Articles

We will go over the purpose of minimal APIs in.NET Core 6, as well as how to implement them step by step.

Prerequisites

  • .NET Core 6 SDK
  • Visual Studio 2022
  • SQL Server

Introduction

  • Minimal APIs are used to create HTTP APIs with minimum dependencies and configuration.
  • Mostly, it is used in microservices that have fewer files and functionality within a single file.
  • But there are a few things that are not supported in minimal APIs, like action filters and built-in validation; also, a few more are still in progress and will get in the future by .NET Team.

Step-by-Step Implementation Using .NET Core 6

Step 1

Create a new .NET Core Web API.

Source de l’article sur DZONE


Prerequisites

  • Basic understanding of .NET Core 6 API and C#.
  • Visual Studio 2022
  • SQL Server

Agenda

  • Create .NET Core API using version 6
  • Configure Hangfire in .NET
  • Look into the different types of jobs that are present in Hangfire.

Overview

  • Hangfire is open-source and used to schedule the job at a particular event and time.
  • It is also used to create, process, and manage your background jobs.
  • We use this in background processing without user intervention.
  • Hangfire is reliable and persistent. It will take care of all things once the job is scheduled.
  • Hangfire dashboard is also available for us to manage all things easily.

Why Hangfire is Required in Background Processing

  • Sometimes we need to do lengthy operations like database updates and database maintenance so it’s managed periodically. 
  • Batch import from XML, JSON, and YAML files.
  • Recurring reports on a periodic basis.
  • Mass notification on subscription and sign up basis.

So, these are things that we are able to do periodically over a certain period of time as per our requirements.

There are different types of jobs that are present in Hangfire. We will look at them one by one.

Source de l’article sur DZONE

I am an « automation fundamentalist ». What I mean by that, is that I will go through large amounts of pain to avoid having to manually type code if I am able to have my computer do it automatically for me. The reasons are fairly self evident, because all bugs originates from a human being having written code at some point in time. Hence, if I can completely avoid manually writing code, the argument is that I can create 100% perfect software systems, that won’t even in theory be allowed to contain bugs of any kind. This idea extends to writing Unit Tests too.

Therefor, I created the ability to automatically generate Unit Tests in Magic. To understand how, watch the following video, where I demonstrate how I invoke an HTTP REST endpoint, for then to persist the invocation, allowing me to « replay » it later. The idea of course, is that being able to replay an HTTP invocation, can help me sanity check my system further down the road, as I modify it for whatever reasons I have to modify it.

Source de l’article sur DZONE