Code
·
34 lines
·
647 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
27
28
29
30
31
32
33
34using MongoDB.Bson;
using MongoDB.Driver;
using MongoDb.Extensions;
namespace MongoExampleFramework
{
public class CrmContext : MongoDbContext
{
public CrmContext() : base("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; }
}
}