Creating a data project
There are many ways of persisting data: document databases, relational databases, and files, to name a few. To avoid complexity in the book, we will use the simplest way of creating blog posts for our project by storing them as JSON in a folder.
To save our blog posts, we will use JSON files stored in a folder, and to do so, we need to create a new project.
Creating a new project
We can create a new project from within Visual Studio (to be honest, that’s how I would do it), but to get to know the .NET CLI, let’s do it from the command line instead.
To create a new project, follow these steps:
- Open a PowerShell prompt.
- Navigate to the
MyBlog
folder. - Create a class library (
classlib
) by typing the following command:dotnet new classlib -o Data
The
dotnet
tool should now have created a folder calledData
.
- We also need to create a project where we can put our models: ...