forked from microsoft/semantic-kernel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathXpoDatabaseEntry.cs
70 lines (61 loc) · 1.89 KB
/
XpoDatabaseEntry.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// Copyright (c) Microsoft. All rights reserved.
using System;
using DevExpress.Xpo;
namespace Microsoft.SemanticKernel.Connectors.Xpo;
public class XpoDatabaseEntry : XPLiteObject
{
public XpoDatabaseEntry(Session session) : base(session)
{
}
private string _oid;
private string _collection;
private string _timestamp;
private string _embeddingString;
private string _metadataString;
private string _key;
[Key(false)]
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
public string Oid
{
get => this._oid;
set => this.SetPropertyValue(nameof(this.Oid), ref this._oid, value);
}
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
public string Key
{
get => this._key;
set => this.SetPropertyValue(nameof(this.Key), ref this._key, value);
}
[Size(SizeAttribute.Unlimited)]
public string MetadataString
{
get => this._metadataString;
set => this.SetPropertyValue(nameof(this.MetadataString), ref this._metadataString, value);
}
[Size(SizeAttribute.Unlimited)]
public string EmbeddingString
{
get => this._embeddingString;
set => this.SetPropertyValue(nameof(this.EmbeddingString), ref this._embeddingString, value);
}
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
public string Timestamp
{
get => this._timestamp;
set => this.SetPropertyValue(nameof(this.Timestamp), ref this._timestamp, value);
}
[Size(SizeAttribute.DefaultStringMappingFieldSize)]
public string Collection
{
get => this._collection;
set => this.SetPropertyValue(nameof(this.Collection), ref this._collection, value);
}
protected override void OnSaving()
{
if (this.Session.IsNewObject(this))
{
this.Oid = Guid.NewGuid().ToString();
}
base.OnSaving();
}
}