Developing the voting application frontend
After deploying the contract into the blockchain network, we need a frontend user interface for interacting with the voting application. The frontend code will then communicate with the smart contract and perform voting operations.
We will now create a Blazor UI frontend to interact with the Solidity smart contract. As Blazor runs on .NET, this example will use the Nethereum library, which is a .NET library for integrating Ethereum smart contracts using C# code.
Installing the necessary packages
First, let’s make sure we add the Nethereum.Web3
package to our Blazor project, either from the NuGet package manager in Visual Studio, as illustrated in the following screenshot, or by running a command-line instruction to install the package:
Figure 14.3 – The Nethereum.Web3 NuGet package
The bash command to add the Nethereum.Web3
package to our .NET solution is as follows:
dotnet add package...