-
Notifications
You must be signed in to change notification settings - Fork 39
/
testing.view
41 lines (36 loc) · 947 Bytes
/
testing.view
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
// ref: views.dll
using System;
using System.Collections.Generic;
using RaptorDB;
namespace SampleViews
{
[RegisterView]
public class testing : View<SalesInvoice>
{
// row schema defined in the script file
// and will be transferred to the client when needed
public class RowSchema : RDBSchema
{
public string Product;
public decimal QTY;
public decimal Price;
public decimal Discount;
}
public testing()
{
this.Name = "testing";
this.Description = "";
this.isPrimaryList = false;
this.isActive = true;
this.BackgroundIndexing = true;
this.Version = 3;
this.Schema = typeof(RowSchema);
this.AddFireOnTypes(typeof(SalesInvoice));
this.Mapper = (api, docid, doc) =>
{
foreach (var i in doc.Items)
api.EmitObject(docid, i);
};
}
}
}