MongoExtensions / src / MongoExample / CrmContext.cs
Code · 27 lines · 585 bytes
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
27using MongoDB.Bson;
using MongoDB.Driver;
using MongoDb.Extensions;


namespace MongoExample;

public class CrmContext() : MongoDbContext("dbCrm")
{
	public IMongoCollection<Klant> KlantTable => Table<Klant>();
	public IMongoCollection<Hypotheek> HypotheekTable => Table<Hypotheek>();
}

public class Hypotheek
{
	public ObjectId Id { get; set; }
	public string? Name { get; set; }
	public string? Rente { get; set; }
}

public class Klant
{
	public ObjectId Id { get; set; }
	public string? Name { get; set; }
	public string? Address { get; set; }
	public int Age { get; set; }
}