An open API service indexing awesome lists of open source software.

https://github.com/scottaddie/contosolending

An ASP.NET Core 3.1 app showcasing gRPC, server-side Blazor, SignalR, and C# 8.
https://github.com/scottaddie/contosolending

asp-net-core azure-functions azure-signalr-service blazor-server dot-net-core grpc signalr-core

Last synced: about 1 year ago
JSON representation

An ASP.NET Core 3.1 app showcasing gRPC, server-side Blazor, SignalR, and C# 8.

Awesome Lists containing this project

README

          

## App overview

This ASP.NET Core 3.1 app represents a loan application processing pipeline. The following table outlines projects found in the solution.

|Project |Description |
|---------------------------------|------------------------------------------------------|
|*ContosoLending.CurrencyExchange*|gRPC project handling currency conversion |
|*ContosoLending.DomainModel* |.NET Standard project containing shared models |
|*ContosoLending.LoanProcessing* |Durable Functions project for handling loan processing|
|*ContosoLending.Ui* |Server-side Blazor UI project |

## Setup

### Install prerequisites

The following software must be installed:

1. [.NET Core SDK version SDK 3.1.100 or later](https://dotnet.microsoft.com/download/dotnet-core/3.1)
1. [Visual Studio 2019 version 16.4 or later](https://visualstudio.microsoft.com/downloads/) with the following workloads:
1. **ASP.NET and web development**
1. **Azure development**

### Provision Azure resources

1. Open the [Azure Cloud Shell](https://shell.azure.com) in your web browser.

1. Run the following command to configure your Azure CLI defaults for resource group and region:

```bash
az configure --defaults group= location=
```

1. Run the following command to provision an Azure Storage account:

```bash
az storage account create --name
```

1. Run the following command to provision an Azure SignalR Service instance:

```bash
az signalr create --name --sku Standard_S1 --service-mode Serverless
```

### Configure the Azure Functions project

1. Create a new *local.settings.json* file in the root of the *ContosoLending.LoanProcessing* project with the following content:

```json
{
"IsEncrypted": false,
"Values": {
"AzureSignalRConnectionString": "",
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "dotnet"
},
"Host": {
"CORS": "https://localhost:44364",
"CORSCredentials": true,
"LocalHttpPort": 7071
}
}
```

1. From the Azure Cloud Shell, run the following command to get the Azure Storage account's connection string:

```bash
az storage account show-connection-string --name --query connectionString
```

Copy the resulting value (without the double quotes) to your clipboard.

1. Replace "<storage_connection_string>" in *local.settings.json* with the value on your clipboard.

1. Run the following command to get the Azure SignalR Service's connection string:

```bash
az signalr key list --name --query primaryConnectionString
```

Copy the resulting value (without the double quotes) to your clipboard.

1. Replace "<signalr_connection_string>" in *local.settings.json* with the value on your clipboard.

## Testing

1. Open the solution file (*src\ContosoLending.sln*).
1. In **Solution Explorer**, right-click the *libman.json* file in the **ContosoLending.Ui** project > **Restore Client-Side Libraries**.
1. In **Solution Explorer**, right-click the solution name > **Properties**.
1. Select the **Multiple startup projects** radio button, and configure the solution as follows:

![multiple project launch configuration in Visual Studio](https://user-images.githubusercontent.com/10702007/68152936-39716780-ff0a-11e9-9f62-babf2267ef77.png)

1. Select the **OK** button.
1. Select the **Start** button next to the **<Multiple Startup Projects>** launch configuration drop-down list.