This repository has been archived by the owner on Dec 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 29
/
DataModels.cs
687 lines (612 loc) · 25.4 KB
/
DataModels.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
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
using System;
using System.Collections.Generic;
using System.Linq;
using Amazon.DynamoDBv2.DataModel;
using ServiceStack.Aws.DynamoDb;
using ServiceStack.DataAnnotations;
namespace ServiceStack.Aws.DynamoDbTests.Shared
{
public class Customer
{
[AutoIncrement]
public int Id { get; set; }
public string Name { get; set; }
public int? Age { get; set; }
public string Nationality { get; set; }
public CustomerAddress PrimaryAddress { get; set; }
public List<Order> Orders { get; set; }
protected bool Equals(Customer other)
{
return Id == other.Id
&& string.Equals(Name, other.Name)
&& Age == other.Age
&& string.Equals(Nationality, other.Nationality)
&& Equals(PrimaryAddress, other.PrimaryAddress)
&& Orders.EquivalentTo(other.Orders);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Customer) obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode*397) ^ (Name != null ? Name.GetHashCode() : 0);
hashCode = (hashCode*397) ^ Age.GetHashCode();
hashCode = (hashCode*397) ^ (Nationality != null ? Nationality.GetHashCode() : 0);
hashCode = (hashCode*397) ^ (PrimaryAddress != null ? PrimaryAddress.GetHashCode() : 0);
hashCode = (hashCode*397) ^ (Orders != null ? Orders.GetHashCode() : 0);
return hashCode;
}
}
}
public class CustomerAddress
{
[AutoIncrement]
public int Id { get; set; }
public int CustomerId { get; set; }
public string AddressLine1 { get; set; }
public string AddressLine2 { get; set; }
public string City { get; set; }
public string State { get; set; }
public string Country { get; set; }
protected bool Equals(CustomerAddress other)
{
return Id == other.Id &&
CustomerId == other.CustomerId &&
string.Equals(AddressLine1, other.AddressLine1) &&
string.Equals(AddressLine2, other.AddressLine2) &&
string.Equals(City, other.City) &&
string.Equals(State, other.State) &&
string.Equals(Country, other.Country);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((CustomerAddress)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ CustomerId;
hashCode = (hashCode * 397) ^ (AddressLine1 != null ? AddressLine1.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (AddressLine2 != null ? AddressLine2.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (City != null ? City.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (State != null ? State.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (Country != null ? Country.GetHashCode() : 0);
return hashCode;
}
}
}
public class Order
{
[AutoIncrement]
public int Id { get; set; }
[References(typeof(Customer))]
public int CustomerId { get; set; }
public string LineItem { get; set; }
public int Qty { get; set; }
public virtual decimal Cost { get; set; }
protected bool Equals(Order other)
{
return Id == other.Id &&
CustomerId == other.CustomerId &&
string.Equals(LineItem, other.LineItem) &&
Qty == other.Qty &&
Cost == other.Cost;
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Order)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ CustomerId;
hashCode = (hashCode * 397) ^ (LineItem != null ? LineItem.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ Qty;
hashCode = (hashCode * 397) ^ Cost.GetHashCode();
return hashCode;
}
}
}
public class OrderWithFieldIndex : Order
{
[Index]
public override decimal Cost { get; set; }
}
[Alias("CustomCostIndex")]
public class OrderCostIndex : ILocalIndex<OrderWithLocalTypedIndex>
{
public int CustomerId { get; set; }
[Index]
public decimal Cost { get; set; }
public int Id { get; set; }
public int Qty { get; set; }
}
[References(typeof(OrderCostIndex))]
public class OrderWithLocalTypedIndex : Order { }
[CompositeKey("ProductId", "Cost")]
public class OrderGlobalCostIndex : IGlobalIndex<OrderWithGlobalTypedIndex>
{
public int ProductId { get; set; }
public decimal Cost { get; set; }
public int Qty { get; set; }
public int Id { get; set; }
}
[References(typeof(OrderGlobalCostIndex))]
public class OrderWithGlobalTypedIndex : Order
{
public int ProductId { get; set; }
}
public class Country
{
[AutoIncrement]
public int Id { get; set; }
public string CountryName { get; set; }
public string CountryCode { get; set; }
protected bool Equals(Country other)
{
return Id == other.Id
&& string.Equals(CountryName, other.CountryName)
&& string.Equals(CountryCode, other.CountryCode);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Country)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ (CountryName != null ? CountryName.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (CountryCode != null ? CountryCode.GetHashCode() : 0);
return hashCode;
}
}
}
public class Node
{
public int Id { get; set; }
public string Name { get; set; }
public List<Node> Children { get; set; }
public Node() { }
public Node(int id, string name, IEnumerable<Node> children = null)
{
Id = id;
Name = name;
if (children != null)
Children = children.ToList();
}
protected bool Equals(Node other)
{
return Id == other.Id &&
string.Equals(Name, other.Name) &&
Children.EquivalentTo(other.Children);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Node)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ (Name != null ? Name.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (Children != null ? Children.GetHashCode() : 0);
return hashCode;
}
}
}
public class Poco
{
public int Id { get; set; }
public string Title { get; set; }
protected bool Equals(Poco other)
{
return Id == other.Id && string.Equals(Title, other.Title);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Poco)obj);
}
public override int GetHashCode()
{
unchecked
{
return (Id * 397) ^ (Title != null ? Title.GetHashCode() : 0);
}
}
}
public class AllTypes<T>
{
public int Id { get; set; }
public int? NullableId { get; set; }
public byte Byte { get; set; }
public short Short { get; set; }
public int Int { get; set; }
public long Long { get; set; }
public ushort UShort { get; set; }
public uint UInt { get; set; }
public ulong ULong { get; set; }
public float Float { get; set; }
public double Double { get; set; }
public decimal Decimal { get; set; }
public string String { get; set; }
public DateTime DateTime { get; set; }
public TimeSpan TimeSpan { get; set; }
public DateTimeOffset DateTimeOffset { get; set; }
public Guid Guid { get; set; }
public char Char { get; set; }
public DateTime? NullableDateTime { get; set; }
public TimeSpan? NullableTimeSpan { get; set; }
public List<string> StringList { get; set; }
public string[] StringArray { get; set; }
public Dictionary<string, string> StringMap { get; set; }
public Dictionary<int, string> IntStringMap { get; set; }
public SubType SubType { get; set; }
public T GenericType { get; set; }
protected bool Equals(AllTypes<T> other)
{
return Id == other.Id && NullableId == other.NullableId
&& Byte == other.Byte
&& Short == other.Short
&& Int == other.Int
&& Long == other.Long
&& UShort == other.UShort
&& UInt == other.UInt
&& ULong == other.ULong
&& Float.Equals(other.Float)
&& Double.Equals(other.Double)
&& Decimal == other.Decimal
&& string.Equals(String, other.String)
&& DateTime.Equals(other.DateTime)
&& TimeSpan.Equals(other.TimeSpan)
&& DateTimeOffset.Equals(other.DateTimeOffset)
&& Guid.Equals(other.Guid)
&& Char == other.Char
&& NullableDateTime.Equals(other.NullableDateTime)
&& NullableTimeSpan.Equals(other.NullableTimeSpan)
&& StringList.EquivalentTo(other.StringList)
&& StringArray.EquivalentTo(other.StringArray)
&& StringMap.EquivalentTo(other.StringMap)
&& IntStringMap.EquivalentTo(other.IntStringMap)
&& Equals(SubType, other.SubType)
&& Equals(GenericType, other.GenericType);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((AllTypes<T>)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
hashCode = (hashCode * 397) ^ Byte.GetHashCode();
hashCode = (hashCode * 397) ^ Short.GetHashCode();
hashCode = (hashCode * 397) ^ Int;
hashCode = (hashCode * 397) ^ Long.GetHashCode();
hashCode = (hashCode * 397) ^ UShort.GetHashCode();
hashCode = (hashCode * 397) ^ (int)UInt;
hashCode = (hashCode * 397) ^ ULong.GetHashCode();
hashCode = (hashCode * 397) ^ Float.GetHashCode();
hashCode = (hashCode * 397) ^ Double.GetHashCode();
hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
hashCode = (hashCode * 397) ^ Guid.GetHashCode();
hashCode = (hashCode * 397) ^ Char.GetHashCode();
hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (GenericType != null ? GenericType.GetHashCode() : 0);
return hashCode;
}
}
}
public class AllTypes
{
public int Id { get; set; }
public int? NullableId { get; set; }
public byte Byte { get; set; }
public short Short { get; set; }
public int Int { get; set; }
public long Long { get; set; }
public ushort UShort { get; set; }
public uint UInt { get; set; }
public ulong ULong { get; set; }
public float Float { get; set; }
public double Double { get; set; }
public decimal Decimal { get; set; }
public string String { get; set; }
public DateTime DateTime { get; set; }
public TimeSpan TimeSpan { get; set; }
public DateTimeOffset DateTimeOffset { get; set; }
public Guid Guid { get; set; }
public char Char { get; set; }
public DateTime? NullableDateTime { get; set; }
public TimeSpan? NullableTimeSpan { get; set; }
public List<string> StringList { get; set; }
public string[] StringArray { get; set; }
public Dictionary<string, string> StringMap { get; set; }
public Dictionary<int, string> IntStringMap { get; set; }
public SubType SubType { get; set; }
protected bool Equals(AllTypes other)
{
return Id == other.Id && NullableId == other.NullableId
&& Byte == other.Byte
&& Short == other.Short
&& Int == other.Int
&& Long == other.Long
&& UShort == other.UShort
&& UInt == other.UInt
&& ULong == other.ULong
&& Float.Equals(other.Float)
&& Double.Equals(other.Double)
&& Decimal == other.Decimal
&& string.Equals(String, other.String)
&& DateTime.Equals(other.DateTime)
&& TimeSpan.Equals(other.TimeSpan)
&& DateTimeOffset.Equals(other.DateTimeOffset)
&& Guid.Equals(other.Guid)
&& Char == other.Char
&& NullableDateTime.Equals(other.NullableDateTime)
&& NullableTimeSpan.Equals(other.NullableTimeSpan)
&& StringList.EquivalentTo(other.StringList)
&& StringArray.EquivalentTo(other.StringArray)
&& StringMap.EquivalentTo(other.StringMap)
&& IntStringMap.EquivalentTo(other.IntStringMap)
&& Equals(SubType, other.SubType);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((AllTypes)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ NullableId.GetHashCode();
hashCode = (hashCode * 397) ^ Byte.GetHashCode();
hashCode = (hashCode * 397) ^ Short.GetHashCode();
hashCode = (hashCode * 397) ^ Int;
hashCode = (hashCode * 397) ^ Long.GetHashCode();
hashCode = (hashCode * 397) ^ UShort.GetHashCode();
hashCode = (hashCode * 397) ^ (int)UInt;
hashCode = (hashCode * 397) ^ ULong.GetHashCode();
hashCode = (hashCode * 397) ^ Float.GetHashCode();
hashCode = (hashCode * 397) ^ Double.GetHashCode();
hashCode = (hashCode * 397) ^ Decimal.GetHashCode();
hashCode = (hashCode * 397) ^ (String != null ? String.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ DateTime.GetHashCode();
hashCode = (hashCode * 397) ^ TimeSpan.GetHashCode();
hashCode = (hashCode * 397) ^ DateTimeOffset.GetHashCode();
hashCode = (hashCode * 397) ^ Guid.GetHashCode();
hashCode = (hashCode * 397) ^ Char.GetHashCode();
hashCode = (hashCode * 397) ^ NullableDateTime.GetHashCode();
hashCode = (hashCode * 397) ^ NullableTimeSpan.GetHashCode();
hashCode = (hashCode * 397) ^ (StringList != null ? StringList.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (StringArray != null ? StringArray.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (StringMap != null ? StringMap.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (IntStringMap != null ? IntStringMap.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (SubType != null ? SubType.GetHashCode() : 0);
return hashCode;
}
}
}
public class SubType
{
public int Id { get; set; }
public string Name { get; set; }
protected bool Equals(SubType other)
{
return Id == other.Id
&& string.Equals(Name, other.Name);
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((SubType)obj);
}
public override int GetHashCode()
{
unchecked
{
return (Id * 397) ^ (Name != null ? Name.GetHashCode() : 0);
}
}
}
public class Collection
{
public int Id { get; set; }
public string Title { get; set; }
public string[] ArrayStrings { get; set; }
public HashSet<string> SetStrings { get; set; }
public List<string> ListStrings { get; set; }
public int[] ArrayInts { get; set; }
public HashSet<int> SetInts { get; set; }
public List<int> ListInts { get; set; }
public Poco[] ArrayPocos { get; set; }
public List<Poco> ListPocos { get; set; }
public Dictionary<int, int> DictionaryInts { get; set; }
public Dictionary<string, string> DictionaryStrings { get; set; }
public Dictionary<string, List<Poco>> PocoLookup { get; set; }
public Dictionary<string, List<Dictionary<string, Poco>>> PocoLookupMap { get; set; }
public Collection InitStrings(params string[] strings)
{
ArrayStrings = strings;
SetStrings = new HashSet<string>(strings);
ListStrings = new List<string>(strings);
DictionaryStrings = new Dictionary<string, string>();
strings.Each(x => DictionaryStrings[x] = x);
PocoLookup = new Dictionary<string, List<Poco>>();
strings.Each(x => PocoLookup[x] = new List<Poco> { new Poco { Id = 1, Title = x } });
PocoLookupMap = new Dictionary<string, List<Dictionary<string, Poco>>>();
strings.Each(x => PocoLookupMap[x] = new List<Dictionary<string, Poco>> {
new Dictionary<string, Poco> { { x, new Poco { Id = 1, Title = x } } }
});
return this;
}
public Collection InitInts(params int[] ints)
{
ArrayInts = ints;
SetInts = new HashSet<int>(ints);
ListInts = new List<int>(ints);
DictionaryInts = new Dictionary<int, int>();
ints.Each(x => DictionaryInts[x] = x);
return this;
}
protected bool Equals(Collection other)
{
return Id == other.Id
&& ArrayStrings.EquivalentTo(other.ArrayStrings)
&& SetStrings.EquivalentTo(other.SetStrings)
&& ListStrings.EquivalentTo(other.ListStrings)
&& ArrayInts.EquivalentTo(other.ArrayInts)
&& SetInts.EquivalentTo(other.SetInts)
&& ListInts.EquivalentTo(other.ListInts)
&& DictionaryInts.EquivalentTo(other.DictionaryInts)
&& DictionaryStrings.EquivalentTo(other.DictionaryStrings)
&& PocoLookup.EquivalentTo(other.PocoLookup, (a, b) => a.EquivalentTo(b))
&& PocoLookupMap.EquivalentTo(other.PocoLookupMap, (a, b) => a.EquivalentTo(b, (m1, m2) => m1.EquivalentTo(m2)));
}
public override bool Equals(object obj)
{
if (ReferenceEquals(null, obj)) return false;
if (ReferenceEquals(this, obj)) return true;
if (obj.GetType() != this.GetType()) return false;
return Equals((Collection)obj);
}
public override int GetHashCode()
{
unchecked
{
var hashCode = Id;
hashCode = (hashCode * 397) ^ (ArrayStrings != null ? ArrayStrings.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (SetStrings != null ? SetStrings.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (ListStrings != null ? ListStrings.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (ArrayInts != null ? ArrayInts.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (SetInts != null ? SetInts.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (ListInts != null ? ListInts.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (DictionaryInts != null ? DictionaryInts.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (DictionaryStrings != null ? DictionaryStrings.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (PocoLookup != null ? PocoLookup.GetHashCode() : 0);
hashCode = (hashCode * 397) ^ (PocoLookupMap != null ? PocoLookupMap.GetHashCode() : 0);
return hashCode;
}
}
}
public class TableWithDynamoAttributes
{
public string A { get; set; }
public string B { get; set; }
[DynamoDBRangeKey]
public string C { get; set; }
[DynamoDBHashKey]
public string D { get; set; }
public string E { get; set; }
}
[CompositeKey("D", "C")]
public class TableWithCompositeKey
{
public string A { get; set; }
public string B { get; set; }
public string C { get; set; }
public string D { get; set; }
public string E { get; set; }
}
public class GlobalIndexWithInterfaceAttrs : IGlobalIndex<TableWithTypedGlobalIndex>
{
public string A { get; set; }
[PrimaryKey]
public string B { get; set; }
public string C { get; set; }
[RangeKey]
public string D { get; set; }
}
[References(typeof(GlobalIndexWithInterfaceAttrs))]
public class TableWithTypedGlobalIndex
{
public string A { get; set; }
public string B { get; set; }
[RangeKey]
public string C { get; set; }
[HashKey]
public string D { get; set; }
public string E { get; set; }
}
public class TableWithConventionNames
{
public string A { get; set; }
public string HashKey { get; set; }
public string RangeKey { get; set; }
}
public class TableWithIdConvention
{
public string A { get; set; }
public string Id { get; set; }
public string RangeKey { get; set; }
}
[ProvisionedThroughput(ReadCapacityUnits = 100, WriteCapacityUnits = 50)]
public class TableWithProvision
{
public string Id { get; set; }
public string A { get; set; }
}
[ProvisionedThroughput(ReadCapacityUnits = 100, WriteCapacityUnits = 50)]
public class GlobalIndexProvision : IGlobalIndex<TableWithGlobalIndexProvision>
{
[PrimaryKey]
public string A { get; set; }
[Index]
public string Id { get; set; }
}
[References(typeof(GlobalIndexProvision))]
public class TableWithGlobalIndexProvision
{
public string Id { get; set; }
public string A { get; set; }
}
}