How to Configure Background Jobs with Dotvvm

In this post we have talked about how to configure and run bckground jobs in a Dotvvm Application. Some of the questions you may ask yourself when you decide to use Dotvvm is if you can use the same frameworks and tools you’re used to when you’re using Asp.NetCore, the answer is yes, and this post shows you how to use hangfire in Dotvvm.

Introduction

Most Web Application/Web Sites follow a simple request/response pattern; the user makes a request to a url and a view is returned to their browser, or they send information through input fields, some processing is done, and an acknowledgement is sent back to them with the status of the operation performed. This pattern works for most processes that will happen on a web application, but there are certain situations where this simple Request - Process - Response pattern doesn’t work or aren‘t suitable for.

Json Property Names in Dotnet Core 3.x

TL;DR

Pre-Dotnet Core 3.0 uses the format below to map incoming json properties to C# model properties

#
1
2
3
4
5
6
public class Model
{
[JsonProperty("first_name")]
public string FirstName

}

Dotnet Core 3.x now uses

#
1
2
3
4
5
6
public class Model
{
[JsonPropertyName("first_name")]
public string FirstName

}

Attempting to use the first version in a Dotnet Core 3.x Application will fail to bind and those properties will be null.

Casting Between Custom Types in C#

This is a follow up from the article on Casting Custom Types To C# Built-In Types.

In the previous article we looked at how we would take a custom object like a Class or a Struct and cast it to a C# built-in like a bool. In this article we will look at how to cast from one custom type to another.

What we will be exploring here is much like what AutoMapper does.

Casting Custom Types To C# Built-In Types

Quick Quiz

What does the code below do?

#
1
2
3
4
5
6
CustomObject c1 = new CustomObject()
bool variableName = Convert.ToBoolean(c1);

//1. variableName is false
//2. runtime exception
//3. It depends

If you’re not sure what the answer is, read on - all will be clear.

Understanding & Creating Dotnet Assemblies

If you’ve been doing C# development for any amount of time, chances are you’ve seen the term “Assembly” or “Assemblies” thrown around pretty often. This article helps the complete beginner understand what Assemblies are, how to use them, and how to make them.

Takeaway


The takeaways from this article are:

  1. Understand what an Assembly is
  2. Understand why they are useful.
  3. Learn how to make one.

Background Jobs with Hangfire in ASP.Net Core

This article discusses background jobs; what they are, why use them and how to set them up in an ASP.Net Core Web Application. There are several options for implementing background jobs but the framework of choice here is hangfire because of its ease of entry for beginners.

Takeaway


The takeaways from this article are:

  1. What background jobs are.
  2. What situation requires Background Jobs.
  3. How to use Hangfire to create background jobs in ASP.Net Core.

Dependency Injection in Asp.Net Core for Beginners - Part 1

There are a lot of concepts that beginner programmers encounter when they start to go beyond writing simple console applications in dotnet and maybe try to build a website. One of such concepts is Dependency Injection (DI).

Takeaway


After reading this article you will know the following:

  1. What dependency Injection is.
  2. Why we need dependency Injection.
  3. How we use/do dependency injection in dotnet core.

Running an ASP.NET Core Web Application on Alibaba Cloud Elastic Computing Service (ECS)

ASP.NET Core is a Microsoft Web Framework for developing Web Applications that can run in any environment, including Windows and Linux servers. According to Microsoft Docs:

ASP.NET Core is a cross-platform, high-performance, open-source framework for building modern, cloud-based, Internet-connected applications.

This tutorial provides detailed step by step instructions for a first time Alibaba Cloud user to create a Linux Elastic Compute Service (ECS) instance and host an ASP.NET Core Application on it.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×