-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathPlant.cs
53 lines (47 loc) · 1.15 KB
/
Plant.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
using Realms;
namespace Examples.Models
{
// :snippet-start: plant-class
public partial class Plant : IRealmObject
{
//:remove-start:
[PrimaryKey]
[MapTo("_id")]
//:remove-end:
[BsonElement("_id")]
public ObjectId Id { get; set; } = ObjectId.GenerateNewId();
[BsonElement("name")]
public string? Name { get; set; }
[BsonElement("sunlight")]
[BsonRepresentation(BsonType.String)]
public string? Sunlight { get; set; }
[BsonElement("color")]
[BsonRepresentation(BsonType.String)]
public string? Color { get; set; }
[BsonElement("type")]
[BsonRepresentation(BsonType.String)]
public string? Type { get; set; }
[BsonElement("_partition")]
public string? Partition { get; set; }
}
public enum Sunlight
{
Full,
Partial
}
public enum PlantColor
{
White,
Green,
Yellow,
Purple
}
public enum PlantType
{
Perennial,
Annual
}
// :snippet-end:
}