We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9c2e816 + a2cfbc9 commit a8a8772Copy full SHA for a8a8772
source/includes/quick-start/Program.cs
@@ -1,5 +1,6 @@
1
using Microsoft.EntityFrameworkCore;
2
using MongoDB.Bson;
3
+using MongoDB.Bson.Serialization.Attributes;
4
using MongoDB.Driver;
5
using MongoDB.EntityFrameworkCore.Extensions;
6
@@ -41,8 +42,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
41
42
43
internal class Movie
44
{
45
+ [BsonId]
46
public ObjectId _id { get; set; }
47
+
48
+ [BsonElement("title")]
49
public string Title { get; set; }
50
51
+ [BsonElement("rated")]
52
public string Rated { get; set; }
53
54
+ [BsonElement("plot")]
55
public string Plot { get; set; }
56
}
0 commit comments