@@ -250,28 +250,66 @@ public Task ComplexSkymambaExample()
250
250
{
251
251
// language=cs
252
252
return VerifySourceGenerator ( """
253
- using System.Collections.Generic;
254
- using BTDB.ODBLayer;
253
+ using System.Collections.Generic;
254
+ using BTDB.ODBLayer;
255
255
256
- public class ContinentMigrationInfo
257
- {
258
- [PrimaryKey(1)]
259
- public ulong CompanyId { get; set; }
260
- }
256
+ public class ContinentMigrationInfo
257
+ {
258
+ [PrimaryKey(1)]
259
+ public ulong CompanyId { get; set; }
260
+ }
261
261
262
- public interface ICompanyTableBase<T> : ICovariantCompanyTableBase<T>, IRelation<T>
263
- where T : class
264
- {
265
- }
262
+ public interface ICompanyTableBase<T> : ICovariantCompanyTableBase<T>, IRelation<T>
263
+ where T : class
264
+ {
265
+ }
266
266
267
- public interface ICovariantCompanyTableBase<out T> : ICovariantRelation<T> where T : class
268
- {
269
- }
267
+ public interface ICovariantCompanyTableBase<out T> : ICovariantRelation<T> where T : class
268
+ {
269
+ }
270
270
271
- public interface IPeripheryMigrationInfoTable : ICompanyTableBase<ContinentMigrationInfo>
272
- {
273
- }
271
+ public interface IPeripheryMigrationInfoTable : ICompanyTableBase<ContinentMigrationInfo>
272
+ {
273
+ }
274
274
275
- """ ) ;
275
+ """ ) ;
276
+ }
277
+
278
+ [ Fact ]
279
+ public Task ComplexSkymambaExample_OrderError ( )
280
+ {
281
+ // language=cs
282
+ return VerifySourceGenerator ( """
283
+ using System.Collections.Generic;
284
+ using BTDB.ODBLayer;
285
+
286
+ public class Item : ICompanyRecord
287
+ {
288
+ [PrimaryKey(1)]
289
+ public ulong CompanyId { get; set; }
290
+
291
+ [PrimaryKey(2)]
292
+ public string Queue { get; set; }
293
+
294
+ [PrimaryKey(3)]
295
+ public Guid ItemId { get; set; }
296
+
297
+ [SecondaryKey(nameof(LockDeadline), IncludePrimaryKeyOrder = 2, Order = 3)]
298
+ public int Priority { get; set; }
299
+
300
+ /// <summary>
301
+ /// The deadline by which the worker should renew lock or complete the work;
302
+ /// after deadline work item is available to other worker.
303
+ /// </summary>
304
+ [SecondaryKey(nameof(LockDeadline), Order = 4)]
305
+ public DateTime LockDeadline { get; set; }
306
+ }
307
+
308
+
309
+ public interface IItemTable : IRelation<Item>
310
+ {
311
+ }
312
+
313
+ """ ) ;
276
314
}
277
315
}
0 commit comments