Skip to content
Navigation Menu
{{ message }}
This repository was archived by the owner on Jul 19, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 140
Expand file tree
/
Copy pathNodeTableGraphViewCodeTemplate.tt
More file actions
700 lines (656 loc) · 18.7 KB
/
Copy pathNodeTableGraphViewCodeTemplate.tt
File metadata and controls
700 lines (656 loc) · 18.7 KB
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
<#@ template language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
<#
var typeDictionary = new Dictionary<string, Tuple<string, string>>
{
{"int", new Tuple<string, string>("int", "Int32")},
{"long", new Tuple<string, string>("bigint", "Int64")},
{"double", new Tuple<string, string>("float", "Double")},
{"string", new Tuple<string, string>("nvarchar(4000)", "String")},
{"bool", new Tuple<string, string>("bit", "Boolean")}
};
#>
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Data.SqlTypes;
using System.Text;
using Microsoft.SqlServer.Server;
public partial class UserDefinedFunctions
{
//edge decoder
<#
foreach (var edge in EdgeList) {
var edgeName = edge.Item1;
var edgeColumnId = edge.Item2;
var variables = edge.Item3; //Attribute name and type
var attributeSize = variables.Count();
var byteSize = (attributeSize - 1) / 8 + 1;
if (attributeSize == 0) {
byteSize = 0;
}
#>
private class <#=edgeName#>DecoderResult
{
public long Sink { get; set; }
public Int32 EdgeId{ get; set; }
<#foreach (var variable in variables) {#>
public Sql<#=typeDictionary[variable.Item2].Item2#> <#=variable.Item1#> { get; set; }
<#}#>
}
public static void <#=edgeName#>Decoder_FillRow(
object tableTypeObject,
out SqlInt64 sink, out SqlInt32 edgeid<#
var indent = " ";
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(",");
Write(indent + "out Sql" + typeDictionary[variables[i].Item2].Item2 + " " + variables[i].Item1);
}#>)
{
var decoderResult = (<#=edgeName#>DecoderResult)tableTypeObject;
sink = decoderResult.Sink;
edgeid = decoderResult.EdgeId;
<#foreach (var variable in variables) {#>
<#=variable.Item1 #> = decoderResult.<#=variable.Item1 #>;
<#}#>
}
[SqlFunction(
DataAccess = DataAccessKind.None,
TableDefinition = "Sink bigint, EdgeId int<#
for (var i = 0; i < variables.Count; ++i)
Write(", " + variables[i].Item1 + " " + typeDictionary[variables[i].Item2].Item1);
#>",
FillRowMethodName = "<#=edgeName#>Decoder_FillRow",
IsDeterministic = true,
IsPrecise = false
)]
public static IEnumerable <#=edgeName#>Decoder(SqlBytes array, SqlBytes deleteEdge, long dumb = 0)
{
//var deleDict = new Dictionary<Int32, bool>();
Dictionary<Int32, bool> deleDict = null;
if (deleteEdge != null && !deleteEdge.IsNull)
{
var delebr = new BinaryReader(deleteEdge.Stream);
while (delebr.BaseStream.Position != delebr.BaseStream.Length)
{
if (deleDict == null)
{
deleDict = new Dictionary<int, bool>();
}
//deleDict.Add(delebr.ReadInt32(), true);
deleDict[delebr.ReadInt32()] = true;
}
}
if (array == null || array.IsNull)
yield break;
var br = new BinaryReader(array.Stream);
var edgeid = (Int32)0;
if (deleDict == null || deleDict.Count == 0)
{
<#if (byteSize != 0) {#>
while (br.BaseStream.Position != br.BaseStream.Length)
{
edgeid++;
<#if (byteSize != 0) {#>
byte[] bitmap = br.ReadBytes(<#=byteSize#>);
<#}#>
var sink = br.ReadInt64();
<#
indent += " ";
var count = 0;
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
var str = "((bitmap["+ (count / 8).ToString() + "]" + " & " + (1 << (count%8)).ToString() + ") == 0)? Sql" + typeDictionary[variableType].Item2 + ".Null" +" :";
if (attributeSize == 0) {
str = "";
}
WriteLine(indent + "var _" + variableName + " = " + str + "br.Read" + typeDictionary[variableType].Item2 + "();");
count++;
}
#>
yield return new <#=edgeName#>DecoderResult
{
Sink = sink, EdgeId = edgeid,
<#
indent += " ";
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(indent + variables[i].Item1 + " = _" + variables[i].Item1 + ",");
}
#>
};
}
<#} else {#>
var len = (int) array.Length;
var longArray = new long[len >> 3];
Buffer.BlockCopy(array.Buffer, 0, longArray, 0, len);
len = len >> 3;
for (int i = 0; i < len; i++)
{
edgeid++;
yield return new <#=edgeName#>DecoderResult
{
Sink = longArray[i], EdgeId = edgeid,
};
}
<#}#>
}
else
{
while (br.BaseStream.Position != br.BaseStream.Length)
{
edgeid++;
<#if (byteSize != 0) {#>
byte[] bitmap = br.ReadBytes(<#=byteSize#>);
<#}#>
var sink = br.ReadInt64();
<#
indent += " ";
var count2 = 0;
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
var str = "((bitmap["+ (count2 / 8).ToString() + "]" + " & " + (1 << (count2%8)).ToString() + ") == 0)? Sql" + typeDictionary[variableType].Item2 + ".Null" +" :";
if (attributeSize == 0) {
str = "";
}
WriteLine(indent + "var _" + variableName + " = " + str + "br.Read" + typeDictionary[variableType].Item2 + "();");
count2++;
}
#>
if (!deleDict.ContainsKey(edgeid)) {
yield return new <#=edgeName#>DecoderResult
{
Sink = sink, EdgeId = edgeid,
<#
indent += " ";
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(indent + variables[i].Item1 + " = _" + variables[i].Item1 + ",");
}
#>
};
}
}
}
}
//Path Decoder
private class <#=edgeName#>ExclusiveEdgeGeneratorResult
{
public int EdgeId{get; set;}
public int EdgeColumnId {get; set;}
public long SinkId{get; set;}
<#foreach (var variable in variables) {#>
public Sql<#=typeDictionary[variable.Item2].Item2#> <#=variable.Item1#> { get; set; }
<#}#>
}
public static void <#=edgeName#>ExclusiveEdgeGenerator_FillRow(
object tableTypeObject,
out SqlInt32 EdgeId, out SqlInt32 EdgeColumnId, out SqlInt64 SinkId <#
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(",");
Write(indent + "out Sql" + typeDictionary[variables[i].Item2].Item2 + " " + variables[i].Item1);
}#>
)
{
var decoderResult = (<#=edgeName#>ExclusiveEdgeGeneratorResult)tableTypeObject;
EdgeId = decoderResult.EdgeId;
EdgeColumnId = decoderResult.EdgeColumnId;
SinkId = decoderResult.SinkId;
<#foreach (var variable in variables) {#>
<#=variable.Item1 #> = decoderResult.<#=variable.Item1 #>;
<#}#>
}
[SqlFunction(
DataAccess = DataAccessKind.None,
TableDefinition = "EdgeId int, EdgeColumnId int, SinkId bigint",
FillRowMethodName = "<#=edgeName#>ExclusiveEdgeGenerator_FillRow",
IsDeterministic = true,
IsPrecise = false
)]
public static IEnumerable <#=edgeName#>ExclusiveEdgeGenerator(SqlBytes PathVarbinary, SqlInt64 nodeid, SqlBytes array, SqlBytes dele)
{
if (array == null || array.IsNull)
yield break;
//Stream PathMemory = (PathVarbinary != null && !PathVarbinary.IsNull) ? PathVarbinary.Stream : new MemoryStream();
//var brPath = new BinaryReader(PathMemory);
//var PathDict = new Dictionary<Tuple<long, long, Int32>, bool>();
//if (PathVarbinary != null && !PathVarbinary.IsNull) {
// while (brPath.BaseStream.Position != brPath.BaseStream.Length)
// {
// var Edgeid = Tuple.Create(brPath.ReadInt64(), brPath.ReadInt64(), brPath.ReadInt32());
// PathDict[Edgeid] = true;
// }
//}
var len = (int) PathVarbinary.Length;
var longArray = new long[len >> 3];
Buffer.BlockCopy(PathVarbinary.Buffer, 0, longArray, 0, len);
//var PathDict = new Dictionary<int, bool>();
Dictionary<int, bool> PathDict = null;
len = len >> 3;
if (PathVarbinary != null && !PathVarbinary.IsNull) {
for (int i = 0; i < len; i += 2)
{
if (longArray[i] == nodeid.Value) {
var Edgeid = (int)longArray[i+1];
if (PathDict == null) {
PathDict = new Dictionary<int, bool>();
}
PathDict.Add(Edgeid,true);
}
}
}
//var len = (int) PathVarbinary.Length;
//var PathDict = new Dictionary<Tuple<long, long, Int32>, bool>();
//if (PathVarbinary != null && !PathVarbinary.IsNull) {
// for (int i = 0; i < len; i += 24)
// {
// var Edgeid = Tuple.Create(BitConverter.ToInt64(PathVarbinary.Buffer, i),
// BitConverter.ToInt64(PathVarbinary.Buffer, i + 8),
// (int)BitConverter.ToInt64(PathVarbinary.Buffer, i + 16));
// PathDict[Edgeid] = true;
// }
//}
if (PathDict == null || PathDict.Count == 0)
{
foreach (var it in <#=edgeName#>Decoder(array, dele))
{
var adjacent = it as <#=edgeName#>DecoderResult;
var EdgeId = Tuple.Create(nodeid.Value, <#=edgeColumnId#>, adjacent.EdgeId);
yield return new <#=edgeName#>ExclusiveEdgeGeneratorResult
{
EdgeId = adjacent.EdgeId,
EdgeColumnId = <#=edgeColumnId#>,
SinkId = adjacent.Sink, <#
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(indent + variables[i].Item1 + " = adjacent." + variables[i].Item1 + ",");
}
#>
};
}
}
else
{
foreach (var it in <#=edgeName#>Decoder(array, dele))
{
var adjacent = it as <#=edgeName#>DecoderResult;
var EdgeId = adjacent.EdgeId;
if (!PathDict.ContainsKey(EdgeId))
{
yield return new <#=edgeName#>ExclusiveEdgeGeneratorResult
{
EdgeId = adjacent.EdgeId,
EdgeColumnId = <#=edgeColumnId#>,
SinkId = adjacent.Sink, <#
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(indent + variables[i].Item1 + " = adjacent." + variables[i].Item1 + ",");
}
#>
};
}
}
}
yield break;
}
//Path Decoder(differ nodes)
private class <#=edgeName#>ExclusiveNodeGeneratorResult
{
public long SinkId{get; set;}
}
public static void <#=edgeName#>ExclusiveNodeGenerator_FillRow(
object tableTypeObject,
out SqlInt64 SinkId)
{
var decoderResult = (<#=edgeName#>ExclusiveNodeGeneratorResult)tableTypeObject;
SinkId = decoderResult.SinkId;
}
[SqlFunction(
DataAccess = DataAccessKind.None,
TableDefinition = "SinkId bigint",
FillRowMethodName = "<#=edgeName#>ExclusiveNodeGenerator_FillRow",
IsDeterministic = true,
IsPrecise = false
)]
public static IEnumerable <#=edgeName#>ExclusiveNodeGenerator(SqlBytes PathVarbinary, SqlBytes array, SqlBytes dele)
{
if (array == null || array.IsNull)
yield break;
bool temp;
var len = (int) PathVarbinary.Length;
var longArray = new long[len >> 3];
Buffer.BlockCopy(PathVarbinary.Buffer, 0, longArray, 0, len);
var PathDict = new Dictionary<long, bool>();
len = len >> 3;
for (int i = 0; i < len; i++)
{
PathDict.Add(longArray[i],true);
}
foreach (var it in <#=edgeName#>Decoder(array, dele))
{
var adjacent = it as <#=edgeName#>DecoderResult;
if (!PathDict.TryGetValue(adjacent.Sink, out temp))
{
yield return new <#=edgeName#>ExclusiveNodeGeneratorResult
{
SinkId = adjacent.Sink
};
}
}
yield break;
}
[Microsoft.SqlServer.Server.SqlFunction(
DataAccess = DataAccessKind.None,
IsDeterministic = true,
IsPrecise = true)]
public static SqlBytes <#=edgeName#>Recycle(SqlBytes src, SqlBytes toRecycle)
{
if (src.IsNull || src.Length == 0)
{
return SqlBytes.Null;
}
if (toRecycle.IsNull || src.Length == 0)
return src;
var toRecycleArray = new Int32[(int)toRecycle.Length];
Buffer.BlockCopy(toRecycle.Value, 0, toRecycleArray, 0, (int)toRecycle.Length);
var toRecycleHashTable = new Hashtable();
for (var i = 0; i < toRecycleArray.Length; ++i)
{
if (toRecycleHashTable.Contains(toRecycleArray[i]))
{
var itemCount = (int) toRecycleHashTable[toRecycleArray[i]];
toRecycleHashTable[toRecycleArray[i]] = itemCount + 1;
}
else
toRecycleHashTable.Add(toRecycleArray[i], 1);
}
var br = new BinaryReader(src.Stream);
var resultMs = new MemoryStream();
var bw = new BinaryWriter(resultMs);
var edgeid = (Int32)0;
while (br.BaseStream.Position < br.BaseStream.Length)
{
<#if (byteSize != 0) {#>
//read bitmap
byte[] bitmap = br.ReadBytes(<#=byteSize#>);
<#}#>
// read
var sink = br.ReadInt64();
edgeid++;
if (toRecycleHashTable.Contains(edgeid))
{
<#var count3 = 0;
foreach (var variable in variables)
{
string str = "(bitmap["+ (count3 / 8).ToString() + "]" + " & " + (1 << (count3%8)).ToString() + ") != 0";
count3++;
var variableName = variable.Item1;
var variableType = variable.Item2;
WriteLine(indent + "if("+ str + ") {");
WriteLine(indent + "br.Read" + typeDictionary[variableType].Item2 + "();");
WriteLine(indent + "}" );
}
#>
continue;
}
// write
<#if (byteSize != 0) {#>
bw.Write(bitmap);
<#}#>
bw.Write(sink);
<#
indent = " ";
var _count = 0;
foreach (var variable in variables)
{
string str = "(bitmap["+ (_count / 8).ToString() + "]" + " & " + (1 << (_count%8)).ToString() + ") != 0";
_count++;
var variableName = variable.Item1;
var variableType = variable.Item2;
WriteLine(indent + "if("+ str + ") {");
WriteLine(indent + "bw.Write(br.Read" + typeDictionary[variableType].Item2 + "());");
WriteLine(indent + "}" );
} #>
}
return new SqlBytes(resultMs);
}
<# }#>
}
//edge encoder
<#foreach (var edge in EdgeList) {
var edgeName = edge.Item1;
var variables = edge.Item3;
var attributeSize = variables.Count();
var byteSize = (attributeSize - 1) / 8 + 1;
if (attributeSize == 0) {
byteSize = 0;
}
#>
[Serializable]
[Microsoft.SqlServer.Server.SqlUserDefinedAggregate(Format.UserDefined,
IsInvariantToNulls = true,
IsInvariantToOrder = true,
IsInvariantToDuplicates = false,
MaxByteSize = -1)]
public struct <#=edgeName#>Encoder : IBinarySerialize
{
private MemoryStream _stream;
private BinaryWriter _writer;
public void Init()
{
_stream = new MemoryStream();
_writer = new BinaryWriter(_stream);
}
public void Accumulate(
SqlInt64 sink<#
var indent = " ";
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(",");
Write(indent + "Sql" + typeDictionary[variables[i].Item2].Item2 + " " + variables[i].Item1);
}#>)
{
if (sink.IsNull)
return;
<#if (byteSize != 0) {#>
Byte[] bitmap = new Byte[<#=byteSize#>];
Array.Clear(bitmap, 0, bitmap.Length);
<#}#>
<#
var count = 0;
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
var pos = count / 8;
var bit = (1 << (count % 8));
#>
if (!<#=variableName#>.IsNull) {
bitmap[<#=pos#>] |= <#=bit#>;
}
<#
count++;
}
#>
<#if (byteSize != 0) {#>
_writer.Write(bitmap);
<#}#>
_writer.Write(sink.Value);
<#
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
#>
if (!<#=variableName#>.IsNull) {
_writer.Write(<#=variableName#>.Value);
}
<#
}
#>
}
public void Merge (<#=edgeName#>Encoder group)
{
_writer.Write(group._stream.GetBuffer(), 0, (int) group._stream.Length);
}
public SqlBytes Terminate()
{
return new SqlBytes(_stream);
}
public void Read(BinaryReader r)
{
if (_stream != null)
_stream.Dispose();
if (_writer != null)
_writer.Dispose();
_stream = new MemoryStream();
_writer = new BinaryWriter(_stream);
_writer.Write(r.ReadBytes((int)r.BaseStream.Length));
}
public void Write(BinaryWriter w)
{
w.Write(_stream.GetBuffer(), 0, (int) _stream.Length);
}
}
<#}#>
public partial class UserDefinedFunctions
{
//path message encoder
<#
foreach (var edge in EdgeList) {
var edgeName = edge.Item1;
var edgeColumnId = edge.Item2;
var variables = edge.Item3;
var attributeSize = variables.Count() + 1;//User-supplied Id may be null
var byteSize = (attributeSize - 1) / 8 + 1;
#>
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlBytes <#=edgeName#>_PathMessageEncoder(SqlString nodeType, SqlString Id,
SqlString edgeType<#var indent = " ";
for (var i = 0; i < variables.Count; ++i)
{
WriteLine(",");
Write(indent + "Sql" + typeDictionary[variables[i].Item2].Item2 + " " + variables[i].Item1);
}#>)
{
MemoryStream _stream = new MemoryStream();
BinaryWriter _writer = new BinaryWriter(_stream);
Byte[] bitmap = new Byte[<#=byteSize#>];
Array.Clear(bitmap, 0, bitmap.Length);
if (!Id.IsNull)
{
bitmap[0] |= 1;
}
<#
var count = 1;
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
var pos = count / 8;
var bit = (1 << (count % 8));
#>
if (!<#=variableName#>.IsNull) {
bitmap[<#=pos#>] |= <#=bit#>;
}
<#
count++;
}
#>
_writer.Write(bitmap);
_writer.Write(nodeType.Value);
if (!Id.IsNull)
{
_writer.Write(Id.Value);
}
_writer.Write(edgeType.Value);
<#
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
#>
if (!<#=variableName#>.IsNull) {
_writer.Write(<#=variableName#>.Value);
}
<#
}
#>
return new SqlBytes(_stream);
}
//path message decoder
[Microsoft.SqlServer.Server.SqlFunction]
public static SqlString <#=edgeName#>_PathMessageDecoder(SqlBytes array, SqlString nodeType, SqlString id)
{
if (array == null || array.IsNull)
return new SqlString("[" +
(nodeType.Value + (id.IsNull ? "" : id.Value.ToString())) +"]");
var br = new BinaryReader(array.Stream);
string res = "[";
while (br.BaseStream.Position != br.BaseStream.Length)
{
byte[] bitmap = br.ReadBytes(<#=byteSize#>);
res += "{\"NodeType\":\"";
res += br.ReadString() + "\", \"Id\":";
if ((bitmap[0] & 1) != 0) {
res += "\"" + br.ReadString() + "\"}, {\"EdgeType\":\"";
} else {
res += "null}, {\"EdgeType\":\"";
}
res += br.ReadString() + "\"";
<#if (variables.Count != 0) {#>
res += ", \"Attribute\":{";
<#
indent += " ";
count = 1;
foreach (var variable in variables)
{
var variableName = variable.Item1;
var variableType = variable.Item2;
if (count != 1)
{
#> res += ",";
<# }
#>
res += "\"<#=variableName#>\":";
if ((bitmap[<#=(count / 8).ToString()#>] & <#=(1 << (count%8)).ToString()#>) != 0) {
<#if (variableType.ToLower() == "string") {#>
res += "\"" + br.Read<#=typeDictionary[variableType].Item2#>().ToString() + "\"";
<#} else {#>
res += br.Read<#=typeDictionary[variableType].Item2#>().ToString().ToLower();
<#}#>
} else {
res += "null";
}
<# count++;
}#>
res += "}";
<#}#>
res += "}, ";
}
res += "{\"NodeType\":\"";
res += nodeType.Value + "\", \"Id\":";
if (!id.IsNull)
{
res += "\"" + id.Value + "\"}";
}
else
{
res += "null}";
}
res += "]";
return new SqlString(res);
}
<#}#>
}
You can’t perform that action at this time.
