Part 1: Getting started with Blazor Server Web App Development using .NET 8
Learn how to get started with Blazor Server web app development using .NET 8. Explore tutorials and tips at Facile TechnoLab.
Web App DevelopmentBlazor
Part 1: Getting started with Blazor Server Web App Development using .NET 8
Prashant Lakhlani
Thursday, January 4, 2024
Learn how to get started with Blazor Server web app development using .NET 8. Explore tutorials and tips at Facile TechnoLab.
If you are reading this article, I assume you are already aware about ASP.NET Core Blazor but if not, you can read a brief introductory article that I posted earlier here. Please follow along with me if you also want to learn building awesome web application using latest .NET 8 and related tech stack.
Next you will need MongoDB compass MSI and install it. You will need this tool to connect with your MongoDB Community Server and do the database administration related activities. If you are familiar with Microsoft SQL Server world, MongoDB compass is like SQL Server Management Studio of MongoDB world.
We will be using a sample existing database called Northwind that I've downloaded from here
Import Northwind Mongodb Database
Open MongoDB Compass and connect to localhost:27017 which is a default port when you install MongoDB Server on windows.
Click on the databasese in the left navigation and create a new database with name northwind and collection sample.
Go to github repository here in your browser, click on code in the top right and then download zip menu to download the zip file.
Extract MongoDB command line database tools zip file
Open mongo-import.sh inside the root folder and change the mongoimport keyword with the actual full path of mongoimport.exe that is part of MongoDb command line database tools zip file. The resulting line will look like below: "C:\temp\import\mongodb-database-tools\bin\mongoimport" -d "$1" -c "$collection" --type json --file "$file"
Open command prompt and go to root folder where you have mongo-import.sh file and run command ./mongo-import.sh northwind
If everything is done correctly, you will see console message that displays the json file name and the number of documents imported.
If you switch back to MongoDB Compass, select northwind database and click on the refresh at the top right corner of the sidebar, you will see collections like customers, employees etc.
We are going to use this sample database to build something interesting that makes sense and has a real-life use cases instead of just a sample table with a few fields.
Conclusion
In this article, we covered the roadmap of the blazor web app development series, the preparation by installing all the needed tools and got our Northwind sample MongoDB database which actually has lots of sample data to try some interesting things with it.
Subscribe to Facile Technolab's monthly newsletter to receive updates on our latest news, offers, promotions, resources, source code, jobs and other exciting updates.