Latest Posts On Code Maze

Introduction to Cloud Computing and Azure

Introduction to Cloud Computing and Azure

In this article, we are going to discuss the fundamentals of Cloud Computing and Microsoft Azure. To read more about Azure, you can visit our Azure with ASP.NET Core page, where you can find all the articles from the series. What is Cloud Computing? Cloud Computing is...

FluentValidation Validators in C#: Built-in and Custom

FluentValidation Validators in C#: Built-in and Custom

FluentValidation validates .NET objects with rules written in code rather than attributes on the model. We declare a class deriving from AbstractValidator<T> and add one RuleFor() chain per property. The library ships validators for the cases we hit constantly:...

FluentValidation in ASP.NET Core

FluentValidation in ASP.NET Core

In this article, we're going to discuss the use of FluentValidation in ASP.NET Core. Traditionally, most validation in .NET is done using Data Annotations: public class SampleClass { [Required] public int Id { get; set; }     [MaxLength(100)] public string Name { get;...

Introduction to gRPC in ASP.NET Core With MongoDB

Introduction to gRPC in ASP.NET Core With MongoDB

In this article, we’re going to cover how to set up an ASP.NET Core gRPC service with MongoDB as our database. MongoDB is an increasingly popular database and is often integrated with a gRPC service. Integration with MongoDB has been covered in a previous article so...

SignalR withAutomaticReconnect: Automatic Reconnect Options

SignalR withAutomaticReconnect: Automatic Reconnect Options

A SignalR client does not reconnect on its own. Calling withAutomaticReconnect() on HubConnectionBuilder opts the connection in, and the client then retries after 0, 2, 10 and 30 seconds before giving up. Those four attempts are the whole default. Pass an array of...

SignalR: Send a Message to a Specific Client in ASP.NET Core

SignalR: Send a Message to a Specific Client in ASP.NET Core

To send a SignalR message to one client, call Clients.Client(connectionId).SendAsync("methodName", data) from inside the hub. The connection id comes from Context.ConnectionId, which SignalR assigns when the client connects. That works for a single connection. For...

Role-Based Authorization with Blazor WebAssembly

Role-Based Authorization with Blazor WebAssembly

Up until now, we have learned how to use AuthenticationStateProvider in Blazor WebAssembly. Additionally, we have learned how to create registration functionality as well as Login and Logout functionalities in our application. But what about the roles? Well, in this...

AuthenticationStateProvider in Blazor WebAssembly

AuthenticationStateProvider in Blazor WebAssembly

Now that we know the basics of Blazor WebAssembly, we can move on to learning about authentication and authorization. In this article, we are going to explore how to accomplish these actions by inspecting the AuthenticationStateProvider. We are going to create a test...

Sorting in Blazor WebAssembly and ASP.NET Core Web API

Sorting in Blazor WebAssembly and ASP.NET Core Web API

Sorting in Blazor WebAssembly is implemented similarly to any other application type. And by sorting, we mean ordering the data fetched from the backend by using some criterium. For example, the criterium is often a product name. It can also be something like the...

Blazor WebAssembly Searching with ASP.NET Core Web API

Blazor WebAssembly Searching with ASP.NET Core Web API

In this part of the series, we are going to explain how to create one version of Blazor WebAssembly Searching functionality. In this example, we are going to implement a search by product name, but later on, you can modify it to your needs. As we did in a previous...

Blazor WebAssembly Pagination with ASP.NET Core Web API

Blazor WebAssembly Pagination with ASP.NET Core Web API

In this article, we are going to learn how to create a Blazor WebAssembly Pagination by consuming data from our Web API server project. We already have the server-side logic to provide the data to the client, but now, we are going to modify it to fit the pagination...

Using Refresh Tokens in ASP.NET Core Authentication

Using Refresh Tokens in ASP.NET Core Authentication

In this article, we are going to learn about refresh tokens and their use in modern web application development. This is part of the ASP.NET Core Authentication with JWT and Angular series. [sc name="patreon-source-code"...

A Few Different Ways to Concatenate Strings in C#

A Few Different Ways to Concatenate Strings in C#

In this quick tutorial, we are going to talk about different ways to concatenate strings. Splitting and joining strings are commonly used operations in almost any real-world application, so let's see how we can concatenate strings through some examples. We won't cover...