In this section, we will have a look at how to read a list of work items from the MongoDB database and also how to insert a new work item into the database. I call them work items, because a work item can be a task or a bug. This can be done by performing the following steps:
- In the Models folder, create a new class called WorkItem, as shown in the following screenshot:
- Add the following code to the WorkItem class. You will notice that Id is of type ObjectId. This represents the unique identifier in the MondoDB document that gets created.
You need to ensure that you add the following using statement to your WorkItem class using MongoDB.Bson;.
Take a look the following code:
public class WorkItem { public ObjectId Id { get; set; } public string Title { get; set; } public string Description { get; set; } public int Severity...