-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathentity.beef.json
1713 lines (1713 loc) · 90 KB
/
entity.beef.json
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
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{
"title": "JSON Schema for Beef Entity code-generation (https://github.com/Avanade/Beef).",
"$schema": "https://json-schema.org/draft-04/schema#",
"definitions": {
"CodeGeneration": {
"type": "object",
"title": "'CodeGeneration' object (entity-driven)",
"description": "The 'CodeGeneration' object defines global properties that are used to drive the underlying entity-driven code generation.",
"properties": {
"refDataNamespace": {
"type": "string",
"title": "The namespace for the Reference Data entities (adds as a c# 'using' statement).",
"description": "Defaults to 'Company' + '.' (literal) + AppName + '.' (literal) + 'EntityUsing' + '.Entities' (literal)."
},
"refDataCommonNamespace": {
"type": "string",
"title": "The namespace for the Reference Data common entities (adds as a c# 'using' statement).",
"description": "Defaults to 'Company' + '.' (literal) + AppName + '.Common.Entities' (literal)."
},
"refDataText": {
"type": "boolean",
"title": "Indicates whether a corresponding 'Text' property is added when generating a Reference Data 'Property' for an 'Entity'.",
"description": "This is used where serializing within the Web API 'Controller' and the 'ExecutionContext.IsRefDataTextSerializationEnabled' is set to 'true' (which is automatically set where the url contains '$text=true')."
},
"refDataWebApiRoute": {
"type": "string",
"title": "The 'RouteAtttribute' for the Reference Data Web API controller required for named pre-fetching. The 'WebApiRoutePrefix' will be prepended where specified."
},
"refDataCache": {
"type": "string",
"title": "The cache used for the ReferenceData providers.",
"description": "Defaults to 'ReferenceDataCache'. A value of 'ReferenceDataCache' specifies a single-tenant cache; otherwise, 'ReferenceDataMultiTenantCache' for a multi-tenant cache leverageing the 'ExecutionContext.TenantId'.",
"enum": [
"ReferenceDataCache",
"ReferenceDataMultiTenantCache"
]
},
"refDataAppendToNamespace": {
"type": "string",
"title": "The Reference Data entity namespace appended to end of the standard 'company.appname.Common.Entities.{AppendToNamespace}'.",
"description": "Defaults to 'null'; being nothing to append."
},
"refDataBusNamespace": {
"type": "string",
"title": "The namespace for the Reference Data entities (adds as a c# 'using' statement) for additional business-layer inclusion where requried."
},
"entityScope": {
"type": "string",
"title": "The entity scope option.",
"description": "Defaults to 'Common' for backwards compatibility; 'Autonomous' is **recommended**. Determines where the entity is scoped/defined, being 'Common' or 'Business' (i.e. not externally visible). Additionally, there is the special case of 'Autonomous' where both a 'Common' and 'Business' entity are generated (where only the latter inherits from 'EntityBase', etc).",
"enum": [
"Common",
"Business",
"Autonomous"
]
},
"entityUsing": {
"type": "string",
"title": "The namespace for the non Reference Data entities (adds as a c# <c>using</c> statement).",
"description": "Defaults to 'Common' (unless 'EntityScope' is 'Autonomous' and then it will default to 'Business') which will add '.Common.Entities'. Additionally, 'Business' to add '.Business.Entities', 'All' to add both, and 'None' to exclude any. This can be overridden for each 'Entity'.",
"enum": [
"Common",
"Business",
"All",
"None"
]
},
"jsonSerializer": {
"type": "string",
"title": "The JSON Serializer to use for JSON property attribution.",
"description": "Defaults to 'Newtonsoft'. This can be overridden within the 'Entity'(s).",
"enum": [
"None",
"Newtonsoft"
]
},
"etagJsonName": {
"type": "string",
"title": "The default JSON name for the 'ETag' property.",
"description": "Defaults to 'etag'. Note that the 'JsonName' can be set individually per property where required.",
"enum": [
"etag",
"eTag",
"_etag",
"_eTag",
"ETag",
"ETAG"
]
},
"usingNamespace1": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Entity' code.",
"description": "Typically used where referening a 'Type' from a Namespace that is not generated by default."
},
"usingNamespace2": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Entity' code.",
"description": "Typically used where referening a 'Type' from a Namespace that is not generated by default."
},
"usingNamespace3": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Entity' code.",
"description": "Typically used where referening a 'Type' from a Namespace that is not generated by default."
},
"webApiAuthorize": {
"type": "string",
"title": "The authorize attribute value to be used for the corresponding entity Web API controller; generally either 'Authorize' or 'AllowAnonymous'.",
"description": "This can be overridden within the 'Entity'(s) and/or their corresponding 'Operation'(s)."
},
"appBasedAgentArgs": {
"type": "boolean",
"title": "Indicates whether to create and use a domain-specific 'WebApi.WebApiAgentArgs' to simplify dependency injection usage."
},
"webApiAutoLocation": {
"type": "boolean",
"title": "Indicates whether the HTTP Response Location Header route ('Operation.WebApiLocation') is automatically inferred.",
"description": "This will automatically set the 'Operation.WebApiLocation' for an 'Operation' named 'Create' where there is a corresponding named 'Get'. This can be overridden within the 'Entity'(s)."
},
"webApiRoutePrefix": {
"type": "string",
"title": "The 'RoutePrefixAtttribute' for the corresponding entity Web API controller.",
"description": "This is the base (prefix) 'URI' prepended to all entity and underlying 'Operation'(s)."
},
"validatorLayer": {
"type": "string",
"title": "The namespace for the Reference Data entities (adds as a c# 'using' statement).",
"description": "Defaults to 'Business'. A value of 'Business' indicates that the Validators will be defined within the 'Business' namespace/assembly; otherwise, defined within the 'Common' namespace/assembly.",
"enum": [
"Business",
"Common"
]
},
"databaseName": {
"type": "string",
"title": "The .NET database interface name (used where 'Operation.AutoImplement' is 'Database').",
"description": "Defaults to 'IDatabase'. This can be overridden within the 'Entity'(s)."
},
"databaseSchema": {
"type": "string",
"title": "The default database schema name.",
"description": "Defaults to 'dbo'."
},
"entityFrameworkName": {
"type": "string",
"title": "The .NET Entity Framework interface name used where 'Operation.AutoImplement' is 'EntityFramework'.",
"description": "Defaults to 'IEfDb'. This can be overridden within the 'Entity'(s)."
},
"cosmosName": {
"type": "string",
"title": "The .NET Entity Framework interface name used where 'Operation.AutoImplement' is 'Cosmos'.",
"description": "Defaults to 'ICosmosDb'. This can be overridden within the 'Entity'(s)."
},
"odataName": {
"type": "string",
"title": "The .NET OData interface name used where 'Operation.AutoImplement' is 'OData'.",
"description": "Defaults to 'IOData'. This can be overridden within the 'Entity'(s)."
},
"httpAgentName": {
"type": "string",
"title": "The default .NET HTTP Agent interface name used where 'Operation.AutoImplement' is 'HttpAgent'.",
"description": "Defaults to 'IHttpAgent'. This can be overridden within the 'Entity'(s)."
},
"refDataDefaultMapperConverter": {
"type": "string",
"title": "The default Reference Data property 'Converter' used by the generated 'Mapper'(s) where not specifically defined.",
"description": "Defaults to 'ReferenceDataCodeConverter<T>'. Where this value is suffixed by '<T>' or '{T}' this will automatically set 'Property.DataConverterIsGeneric' to 'true'.",
"enum": [
"ReferenceDataCodeConverter",
"ReferenceDataCodeConverter{T}",
"ReferenceDataCodeConverter<T>",
"ReferenceDataInt32IdConverter",
"ReferenceDataInt32IdConverter{T}",
"ReferenceDataInt32IdConverter<T>",
"ReferenceDataNullableInt32IdConverter",
"ReferenceDataNullableInt32IdConverter{T}",
"ReferenceDataNullableInt32IdConverter<T>",
"ReferenceDataInt64IdConverter",
"ReferenceDataInt64IdConverter{T}",
"ReferenceDataInt64IdConverter<T>",
"ReferenceDataNullableInt64IdConverter",
"ReferenceDataNullableInt64IdConverter{T}",
"ReferenceDataNullableInt64IdConverter<T>",
"ReferenceDataGuidIdConverter",
"ReferenceDataGuidIdConverter{T}",
"ReferenceDataGuidIdConverter<T>",
"ReferenceDataNullableGuidIdConverter",
"ReferenceDataNullableGuidIdConverter{T}",
"ReferenceDataNullableGuidIdConverter<T>"
]
},
"dataUsingNamespace": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Data' code."
},
"databaseUsingNamespace": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Data' code where 'Operation.AutoImplement' is 'Database'."
},
"entityFrameworkUsingNamespace": {
"type": "string",
"title": "The additional Namespace using statement to be added to the generated 'Data' code where 'Operation.AutoImplement' is 'EntityFramework'."
},
"cosmosUsingNamespace": {
"type": "string",
"title": "additional Namespace using statement to be added to the generated 'Data' code where 'Operation.AutoImplement' is 'Cosmos'."
},
"odataUsingNamespace": {
"type": "string",
"title": "additional Namespace using statement to be added to the generated 'Data' code where 'Operation.AutoImplement' is 'OData'."
},
"eventPublish": {
"type": "string",
"title": "The layer to add logic to publish an event for a 'Create', 'Update' or 'Delete' operation.",
"description": "Defaults to 'DataSvc'; unless the 'EventOutbox' is not 'None' where it will default to 'Data'. Used to enable the sending of messages to the likes of EventHub, Service Broker, SignalR, etc. This can be overridden within the 'Entity'(s).",
"enum": [
"None",
"DataSvc",
"Data"
]
},
"eventOutbox": {
"type": "string",
"title": "The the data-tier event outbox persistence technology (where the events will be transactionally persisted in an outbox as part of the data-tier processing).",
"description": "Defaults to 'None'. A value of 'Database' will result in the 'DatabaseEventOutboxInvoker' being used to orchestrate.",
"enum": [
"None",
"Database"
]
},
"eventSourceRoot": {
"type": "string",
"title": "The URI root for the event source by prepending to all event source URIs.",
"description": "The event source is only updated where an 'EventSourceKind' is not 'None'. This can be extended within the 'Entity'(s)."
},
"eventSourceKind": {
"type": "string",
"title": "The URI kind for the event source URIs.",
"description": "Defaults to 'None' (being the event source is not updated).",
"enum": [
"None",
"Absolute",
"Relative",
"RelativeOrAbsolute"
]
},
"eventSubjectRoot": {
"type": "string",
"title": "The root for the event Subject name by prepending to all event subject names.",
"description": "Used to enable the sending of messages to the likes of EventHub, Service Broker, SignalR, etc. This can be overridden within the 'Entity'(s)."
},
"eventSubjectFormat": {
"type": "string",
"title": "The default formatting for the Subject when an Event is published.",
"description": "Defaults to 'NameAndKey' (being the event subject name appended with the corresponding unique key.)'.",
"enum": [
"NameOnly",
"NameAndKey"
]
},
"eventSubjectSeparator": {
"type": "string",
"title": "The subject path separator.",
"description": "Defaults to '.'. Used only where the subject is automatically inferred."
},
"eventActionFormat": {
"type": "string",
"title": "The formatting for the Action when an Event is published.",
"description": "Defaults to 'None' (no formatting required, i.e. as-is)'.",
"enum": [
"None",
"PastTense"
]
},
"eventCasing": {
"type": "string",
"title": "The casing for the Subject and Action (with the exception of the key)",
"description": "Defaults to 'None' (no casing required, i.e. as-is)'.",
"enum": [
"None",
"Lower",
"Upper"
]
},
"eventTransaction": {
"type": "boolean",
"title": "Indicates whether a 'System.TransactionScope' should be created and orchestrated at the 'DataSvc'-layer whereever generating event publishing logic.",
"description": "Usage will force a rollback of any underlying data transaction (where the provider supports TransactionScope) on failure, such as an 'EventPublish' error. This is by no means implying a Distributed Transaction (DTC) should be invoked; this is only intended for a single data source that supports a TransactionScope to guarantee reliable event publishing. Defaults to 'false'. This essentially defaults the 'Entity.EventTransaction' where not otherwise specified. This should only be used where 'EventPublish' is 'DataSvc' and a transactionally-aware data source is being used."
},
"grpc": {
"type": "boolean",
"title": "Indicates whether gRPC support (more specifically service-side) is required.",
"description": "gRPC support is an explicit opt-in model. Must be set to 'true' for any of the subordinate gRPC capabilities to be code-generated. Will require each 'Entity', and corresponding 'Property' and 'Operation' to be opted-in specifically."
},
"pathBase": {
"type": "string",
"title": "The base path (directory) prefix for the artefacts; other 'Path*' properties append to this value when they are not specifically overridden.",
"description": "Defaults to 'Company' (runtime parameter) + '.' + 'AppName' (runtime parameter). For example 'Beef.Demo'."
},
"pathCommon": {
"type": "string",
"title": "The path (directory) for the Database-related artefacts.",
"description": "Defaults to 'PathBase' + '.Common' (literal). For example 'Beef.Demo.Common'."
},
"pathBusiness": {
"type": "string",
"title": "The path (directory) for the Business-related (.NET) artefacts.",
"description": "Defaults to 'PathBase' + '.Business' (literal). For example 'Beef.Demo.Business'."
},
"pathApi": {
"type": "string",
"title": "The path (directory) for the API-related (.NET) artefacts.",
"description": "Defaults to 'PathBase' + '.' + 'ApiName' (runtime parameter). For example 'Beef.Demo.Api'."
},
"namespaceBase": {
"type": "string",
"title": "The base Namespace (root) for the .NET artefacts.",
"description": "Defaults to 'Company' (runtime parameter) + '.' + 'AppName' (runtime parameter). For example 'Beef.Demo'."
},
"namespaceCommon": {
"type": "string",
"title": "The Namespace (root) for the Common-related .NET artefacts.",
"description": "Defaults to 'NamespaceBase' + '.Common' (literal). For example 'Beef.Demo.Common'."
},
"namespaceBusiness": {
"type": "string",
"title": "The Namespace (root) for the Business-related .NET artefacts.",
"description": "Defaults to 'NamespaceBase' + '.Business' (literal). For example 'Beef.Demo.Business'."
},
"namespaceApi": {
"type": "string",
"title": "The Namespace (root) for the Api-related .NET artefacts.",
"description": "Defaults to 'NamespaceBase' + '.' + 'ApiName' (runtime parameter). For example 'Beef.Demo.Api'."
},
"entities": {
"type": "array",
"title": "The corresponding 'Entity' collection.",
"items": {
"$ref": "#/definitions/Entity"
}
}
}
},
"Entity": {
"type": "object",
"title": "'Entity' object (entity-driven)",
"description": "The 'Entity' is used as the primary configuration for driving the entity-driven code generation.",
"properties": {
"name": {
"type": "string",
"title": "The unique entity name."
},
"text": {
"type": "string",
"title": "The overriding text for use in comments.",
"description": "Overrides the Name (as sentence text) for the summary comments. It will be formatted as: 'Represents the {Text} entity.'. To create a '<see cref=\"XXX\"/>' within use moustache shorthand (e.g. {{Xxx}})."
},
"fileName": {
"type": "string",
"title": "The overriding file name.",
"description": "Overrides the Name as the code-generated file name."
},
"entityScope": {
"type": "string",
"title": "The entity scope option.",
"description": "Defaults to the 'CodeGeneration.EntityScope'. Determines where the entity is scoped/defined, being 'Common' or 'Business' (i.e. not externally visible). Additionally, there is a special case of 'Autonomous' where both a 'Common' and 'Business' entity are generated (where only the latter inherits from 'EntityBase', etc).",
"enum": [
"Common",
"Business",
"Autonomous"
]
},
"entityUsing": {
"type": "string",
"title": "The namespace for the non Reference Data entities (adds as a c# <c>using</c> statement).",
"description": "Defaults to 'EntityScope' ('Autonomous' will result in 'Business'). A value of 'Common' will add '.Common.Entities', 'Business' will add '.Business.Entities', 'All' to add both, and 'None' to exclude any.",
"enum": [
"Common",
"Business",
"All",
"None"
]
},
"privateName": {
"type": "string",
"title": "The overriding private name.",
"description": "Overrides the 'Name' to be used for private fields. By default reformatted from 'Name'; e.g. 'FirstName' as '_firstName'."
},
"argumentName": {
"type": "string",
"title": "The overriding argument name.",
"description": "Overrides the 'Name' to be used for argument parameters. By default reformatted from 'Name'; e.g. 'FirstName' as 'firstName'."
},
"constType": {
"type": "string",
"title": "The Const .NET Type option.",
"description": "The .NET Type to be used for the 'const' values. Defaults to 'string'.",
"enum": [
"int",
"long",
"Guid",
"string"
]
},
"isInitialOverride": {
"type": "boolean",
"title": "Indicates whether to override the 'ICleanup.IsInitial' property.",
"description": "Set to either 'true' or 'false' to override as specified; otherwise, 'null' to check each property. Defaults to 'null'."
},
"refDataType": {
"type": "string",
"title": "The Reference Data identifier Type option.",
"description": "Required to identify an entity as being Reference Data. Specifies the underlying .NET Type used for the Reference Data identifier.",
"enum": [
"int",
"long",
"Guid",
"string"
]
},
"refDataText": {
"type": "boolean",
"title": "Indicates whether a corresponding 'Text' property is added when generating a Reference Data 'Property' overriding the 'CodeGeneration.RefDataText' selection.",
"description": "This is used where serializing within the Web API'Controller' and the 'ExecutionContext.IsRefDataTextSerializationEnabled' is set to 'true' (which is automatically set where the url contains '$text=true')."
},
"refDataSortOrder": {
"type": "string",
"title": "The Reference Data sort order option.",
"description": "Specifies the default sort order for the underlying Reference Data collection. Defaults to 'SortOrder'.",
"enum": [
"SortOrder",
"Id",
"Code",
"Text"
]
},
"refDataStringFormat": {
"type": "string",
"title": "The Reference Data 'ToString' composite format.",
"description": "The string format supports the standard composite formatting; where the following indexes are used: '{0}' for 'Id', '{1}' for 'Code' and '{2}' for 'Text'. Defaults to '{2}'."
},
"inherits": {
"type": "string",
"title": "The base class that the entity inherits from.",
"description": "Defaults to 'EntityBase' for a standard entity. For Reference Data it will default to 'ReferenceDataBaseXxx' depending on the corresponding 'RefDataType' value. See 'OmitEntityBase' if the desired outcome is to not inherit from any of the aforementioned base classes."
},
"implements": {
"type": "string",
"title": "The list of comma separated interfaces that are to be declared for the entity class."
},
"implementsAutoInfer": {
"type": "boolean",
"title": "Indicates whether to automatically infer the interface implements for the entity from the properties declared.",
"description": "Will attempt to infer the following: 'IGuidIdentifier', 'IInt32Identifier', 'IInt64Identifier', 'IStringIdentifier', 'IETag' and 'IChangeLog'. Defaults to 'true'."
},
"abstract": {
"type": "boolean",
"title": "Indicates whether the class should be defined as abstract."
},
"genericWithT": {
"type": "boolean",
"title": "Indicates whether the class should be defined as a generic with a single parameter 'T'."
},
"namespace": {
"type": "string",
"title": "The entity namespace to be appended.",
"description": "Appended to the end of the standard structure as follows: '{Company}.{AppName}.Common.Entities.{Namespace}'."
},
"omitEntityBase": {
"type": "boolean",
"title": "Indicates that the entity should not inherit from 'EntityBase'.",
"description": "As such any of the 'EntityBase' related capabilites are not supported (are omitted from generation). The intention for this is more for the generation of simple internal entities."
},
"jsonSerializer": {
"type": "string",
"title": "The JSON Serializer to use for JSON property attribution.",
"description": "Defaults to the 'CodeGeneration.JsonSerializer' configuration property where specified; otherwise, 'Newtonsoft'.",
"enum": [
"None",
"Newtonsoft"
]
},
"collection": {
"type": "boolean",
"title": "Indicates whether a corresponding entity collection class should be created."
},
"collectionResult": {
"type": "boolean",
"title": "Indicates whether a corresponding entity collection result class should be created",
"description": "Enables the likes of additional paging state to be stored with the underlying collection."
},
"collectionKeyed": {
"type": "boolean",
"title": "Indicates whether the entity collection is keyed using the properties defined as forming part of the unique key."
},
"collectionInherits": {
"type": "string",
"title": "The base class that a 'Collection' inherits from.",
"description": "Defaults to 'EntityBaseCollection' or 'EntityBaseKeyedCollection' depending on 'CollectionKeyed'. For Reference Data it will default to 'ReferenceDataCollectionBase'."
},
"collectionResultInherits": {
"type": "string",
"title": "The base class that a 'CollectionResult' inherits from.",
"description": "Defaults to 'EntityCollectionResult'."
},
"get": {
"type": "boolean",
"title": "Indicates that a 'Get' operation will be automatically generated where not otherwise explicitly specified."
},
"getAll": {
"type": "boolean",
"title": "Indicates that a 'GetAll' operation will be automatically generated where not otherwise explicitly specified."
},
"create": {
"type": "boolean",
"title": "Indicates that a 'Create' operation will be automatically generated where not otherwise explicitly specified."
},
"update": {
"type": "boolean",
"title": "Indicates that a 'Update' operation will be automatically generated where not otherwise explicitly specified."
},
"patch": {
"type": "boolean",
"title": "Indicates that a 'Patch' operation will be automatically generated where not otherwise explicitly specified."
},
"delete": {
"type": "boolean",
"title": "Indicates that a 'Delete' operation will be automatically generated where not otherwise explicitly specified."
},
"autoImplement": {
"type": "string",
"title": "The data source auto-implementation option.",
"description": "Defaults to 'None'. Indicates that the implementation for the underlying 'Operations' will be auto-implemented using the selected data source (unless explicity overridden). When selected some of the related attributes will also be required (as documented). Additionally, the 'AutoImplement' indicator must be selected for each underlying 'Operation' that is to be auto-implemented.",
"enum": [
"Database",
"EntityFramework",
"Cosmos",
"OData",
"HttpAgent",
"None"
]
},
"dataCtor": {
"type": "string",
"title": "The access modifier for the generated 'Data' constructor.",
"description": "Defaults to 'Public'.",
"enum": [
"Public",
"Private",
"Protected"
]
},
"dataCtorParams": {
"type": "array",
"title": "The list of additional (non-inferred) Dependency Injection (DI) parameters for the generated 'Data' constructor.",
"description": "Each constructor parameter should be formatted as 'Type' + '^' + 'Name'; e.g. 'IConfiguration^Config'. Where the 'Name' portion is not specified it will be inferred. Where the 'Type' matches an already inferred value it will be ignored.",
"items": {
"type": "string"
}
},
"dataExtensions": {
"type": "boolean",
"title": "Indicates whether the 'Data' extensions logic should be generated.",
"description": "This can be overridden using 'Operation.DataExtensions'."
},
"databaseName": {
"type": "string",
"title": "The .NET database interface name (used where 'AutoImplement' is 'Database').",
"description": "Defaults to the 'CodeGeneration.DatabaseName' configuration property (its default value is 'IDatabase')."
},
"databaseSchema": {
"type": "string",
"title": "The database schema name (used where 'AutoImplement' is 'Database').",
"description": "Defaults to 'dbo'."
},
"databaseMapperInheritsFrom": {
"type": "string",
"title": "The name of the 'Mapper' that the generated Database 'Mapper' inherits from."
},
"databaseCustomerMapper": {
"type": "boolean",
"title": "Indicates that a custom Database 'Mapper' will be used; i.e. not generated.",
"description": "Otherwise, by default, a 'Mapper' will be generated."
},
"entityFrameworkName": {
"type": "string",
"title": "The .NET Entity Framework interface name used where 'AutoImplement' is 'EntityFramework'.",
"description": "Defaults to the 'CodeGeneration.EntityFrameworkName' configuration property (its default value is 'IEfDb')."
},
"entityFrameworkModel": {
"type": "string",
"title": "The corresponding Entity Framework model name (required where 'AutoImplement' is 'EntityFramework')."
},
"entityFrameworkMapperInheritsFrom": {
"type": "string",
"title": "The name of the 'Mapper that the generated Entity Framework 'Mapper' inherits from.",
"description": "Defaults to 'Model.{Name}'; i.e. an entity with the same name in the 'Model' namespace."
},
"entityFrameworkCustomMapper": {
"type": "boolean",
"title": "Indicates that a custom Entity Framework 'Mapper' will be used; i.e. not generated.",
"description": "Otherwise, by default, a 'Mapper' will be generated."
},
"cosmosName": {
"type": "string",
"title": "The .NET Cosmos interface name used where 'AutoImplement' is 'Cosmos'.",
"description": "Defaults to the 'CodeGeneration.CosmosName' configuration property (its default value is 'ICosmosDb')."
},
"cosmosModel": {
"type": "string",
"title": "The corresponding Cosmos model name (required where 'AutoImplement' is 'Cosmos')."
},
"cosmosContainerId": {
"type": "string",
"title": "The Cosmos 'ContainerId' required where 'AutoImplement' is 'Cosmos'."
},
"cosmosPartitionKey": {
"type": "string",
"title": "The C# code to be used for setting the optional Cosmos 'PartitionKey' where 'AutoImplement' is 'Cosmos'.",
"description": "Defaults to 'PartitionKey.None'."
},
"cosmosValueContainer": {
"type": "boolean",
"title": "Indicates whether the 'CosmosDbValueContainer' is to be used; otherwise, 'CosmosDbContainer'."
},
"cosmosMapperInheritsFrom": {
"type": "string",
"title": "The name of the 'Mapper' that the generated Cosmos 'Mapper' inherits from."
},
"cosmosCustomMapper": {
"type": "boolean",
"title": "Indicates that a custom Cosmos 'Mapper' will be used; i.e. not generated.",
"description": "Otherwise, by default, a 'Mapper' will be generated."
},
"odataName": {
"type": "string",
"title": "The .NET OData interface name used where 'AutoImplement' is 'OData'.",
"description": "Defaults to the 'CodeGeneration.ODataName' configuration property (its default value is 'IOData')."
},
"odataModel": {
"type": "string",
"title": "The corresponding OData model name (required where 'AutoImplement' is 'OData')."
},
"odataCollectionName": {
"type": "string",
"title": "The name of the underlying OData collection where 'AutoImplement' is 'OData'.",
"description": "The underlying 'Simple.OData.Client' will attempt to infer."
},
"odataMapperInheritsFrom": {
"type": "string",
"title": "The name of the 'Mapper' that the generated OData 'Mapper' inherits from."
},
"odataCustomMapper": {
"type": "boolean",
"title": "Indicates that a custom OData 'Mapper' will be used; i.e. not generated.",
"description": "Otherwise, by default, a 'Mapper' will be generated."
},
"httpAgentName": {
"type": "string",
"title": "The .NET HTTP Agent interface name used where 'Operation.AutoImplement' is 'HttpAgent'.",
"description": "Defaults to 'CodeGeneration.HttpAgentName' configuration property (its default value is 'IHttpAgent')."
},
"httpAgentRoutePrefix": {
"type": "string",
"title": "The base HTTP Agent API route where 'Operation.AutoImplement' is 'HttpAgent'.",
"description": "This is the base (prefix) 'URI' for the HTTP Agent endpoint and can be further extended when defining the underlying 'Operation'(s)."
},
"httpAgentModel": {
"type": "string",
"title": "The corresponding HTTP Agent model name (required where 'AutoImplement' is 'HttpAgent').",
"description": "This can be overridden within the 'Operation'(s)."
},
"httpAgentReturnModel": {
"type": "string",
"title": "The corresponding HTTP Agent model name (required where 'AutoImplement' is 'HttpAgent').",
"description": "This can be overridden within the 'Operation'(s)."
},
"dataSvcCaching": {
"type": "boolean",
"title": "Indicates whether request-based 'IRequestCache' caching is to be performed at the 'DataSvc' layer to improve performance (i.e. reduce chattiness).",
"description": "Defaults to 'true'."
},
"dataSvcCtor": {
"type": "string",
"title": "The access modifier for the generated 'DataSvc' constructor.",
"description": "Defaults to 'Public'.",
"enum": [
"Public",
"Private",
"Protected"
]
},
"dataSvcCtorParams": {
"type": "array",
"title": "The list of additional (non-inferred) Dependency Injection (DI) parameters for the generated 'DataSvc' constructor.",
"description": "Each constructor parameter should be formatted as 'Type' + '^' + 'Name'; e.g. 'IConfiguration^Config'. Where the 'Name' portion is not specified it will be inferred. Where the 'Type' matches an already inferred value it will be ignored.",
"items": {
"type": "string"
}
},
"dataSvcExtensions": {
"type": "boolean",
"title": "Indicates whether the 'DataSvc' extensions logic should be generated.",
"description": "This can be overridden using 'Operation.DataSvcExtensions'."
},
"eventPublish": {
"type": "string",
"title": "The layer to add logic to publish an event for a 'Create', 'Update' or 'Delete' operation.",
"description": "Defaults to the 'CodeGeneration.EventPublish' configuration property (inherits) where not specified. Used to enable the sending of messages to the likes of EventGrid, Service Broker, SignalR, etc. This can be overridden within the 'Operation'(s).",
"enum": [
"None",
"DataSvc",
"Data"
]
},
"eventOutbox": {
"type": "string",
"title": "The the data-tier event outbox persistence technology (where the events will be transactionally persisted in an outbox as part of the data-tier processing).",
"description": "Defaults to 'CodeGeneration.EventOutbox' configuration property (inherits) where not specified. A value of 'Database' will result in the 'DatabaseEventOutboxInvoker' being used to orchestrate.",
"enum": [
"None",
"Database"
]
},
"eventSource": {
"type": "string",
"title": "The Event Source.",
"description": "Defaults to 'Name' (as lowercase) appended with the '/{$key}' placeholder. Note: when used in code-generation the 'CodeGeneration.EventSourceRoot' will be prepended where specified. To include the entity id/key include a '{$key}' placeholder ('Create', 'Update' or 'Delete' operation only); for example: 'person/{$key}'. This can be overridden for the 'Operation'."
},
"eventSubjectFormat": {
"type": "string",
"title": "The default formatting for the Subject when an Event is published.",
"description": "Defaults to 'CodeGeneration.EventSubjectFormat'.",
"enum": [
"NameOnly",
"NameAndKey"
]
},
"eventCasing": {
"type": "string",
"title": "The casing for the Subject and Action (with the exception of the key)",
"description": "Defaults to 'CodeGeneration.EventCasing'.",
"enum": [
"None",
"Lower",
"Upper"
]
},
"eventTransaction": {
"type": "boolean",
"title": "Indicates whether a 'System.TransactionScope' should be created and orchestrated at the 'DataSvc'-layer whereever generating event publishing logic.",
"description": "Usage will force a rollback of any underlying data transaction (where the provider supports TransactionScope) on failure, such as an 'EventPublish' error. This is by no means implying a Distributed Transaction (DTC) should be invoked; this is only intended for a single data source that supports a TransactionScope to guarantee reliable event publishing. Defaults to 'CodeGeneration.EventTransaction'. This essentially defaults the 'Operation.DataSvcTransaction' where not otherwise specified. This should only be used where 'EventPublish' is 'DataSvc' and a transactionally-aware data source is being used."
},
"managerCtor": {
"type": "string",
"title": "The access modifier for the generated 'Manager' constructor.",
"description": "Defaults to 'Public'.",
"enum": [
"Public",
"Private",
"Protected"
]
},
"managerCtorParams": {
"type": "array",
"title": "The list of additional (non-inferred) Dependency Injection (DI) parameters for the generated 'Manager' constructor.",
"description": "Each constructor parameter should be formatted as 'Type' + '^' + 'Name'; e.g. 'IConfiguration^Config'. Where the 'Name' portion is not specified it will be inferred. Where the 'Type' matches an already inferred value it will be ignored.",
"items": {
"type": "string"
}
},
"managerExtensions": {
"type": "boolean",
"title": "Indicates whether the 'Manager' extensions logic should be generated.",
"description": "This can be overridden using 'Operation.ManagerExtensions'."
},
"validator": {
"type": "string",
"title": "The name of the .NET 'Type' that will perform the validation.",
"description": "Only used for defaulting the 'Create' and 'Update' operation types ('Operation.Type') where not specified explicitly."
},
"iValidator": {
"type": "string",
"title": "The name of the .NET Interface that the 'Validator' implements/inherits.",
"description": "Only used for defaulting the 'Create' and 'Update' operation types ('Operation.Type') where not specified explicitly."
},
"webApiRoutePrefix": {
"type": "string",
"title": "The 'RoutePrefixAtttribute' for the corresponding entity Web API controller.",
"description": "This is the base (prefix) 'URI' for the entity and can be further extended when defining the underlying 'Operation'(s). The 'CodeGeneration.WebApiRoutePrefix' will be prepended where specified."
},
"webApiAuthorize": {
"type": "string",
"title": "The authorize attribute value to be used for the corresponding entity Web API controller; generally either 'Authorize' or 'AllowAnonymous'.",
"description": "Defaults to the 'CodeGeneration.WebApiAuthorize' configuration property (inherits) where not specified; can be overridden at the 'Operation' level also."
},
"webApiCtor": {
"type": "string",
"title": "The access modifier for the generated Web API 'Controller' constructor.",
"description": "Defaults to 'Public'.",
"enum": [
"Public",
"Private",
"Protected"
]
},
"webApiCtorParams": {
"type": "array",
"title": "The list of additional (non-inferred) Dependency Injection (DI) parameters for the generated 'WebApi' constructor.",
"description": "Each constructor parameter should be formatted as 'Type' + '^' + 'Name'; e.g. 'IConfiguration^Config'. Where the 'Name' portion is not specified it will be inferred. Where the 'Type' matches an already inferred value it will be ignored.",
"items": {
"type": "string"
}
},
"webApiAutoLocation": {
"type": "boolean",
"title": "Indicates whether the HTTP Response Location Header route ('Operation.WebApiLocation') is automatically inferred.",
"description": "This will automatically set the 'Operation.WebApiLocation' for an 'Operation' named 'Create' where there is a corresponding named 'Get'. This is defaulted from the 'CodeGen.WebApiAutoLocation'."
},
"webApiConcurrency": {
"type": "boolean",
"title": "Indicates whether the Web API is responsible for managing (simulating) concurrency via auto-generated ETag.",
"description": "This provides an alternative where the underlying data source does not natively support optimistic concurrency (native support should always be leveraged as a priority). Where the 'Operation.Type' is 'Update' or 'Patch', the request ETag will be matched against the response for a corresponding 'Get' operation to verify no changes have been made prior to updating. For this to function correctly the .NET response Type for the 'Get' must be the same as that returned from the corresponding 'Create', 'Update' and 'Patch' (where applicable) as the generated ETag is a SHA256 hash of the resulting JSON. This defaults the 'Operation.WebApiConcurrency'."
},
"webApiGetOperation": {
"type": "string",
"title": "The corresponding 'Get' method name (in the 'XxxManager') where the 'Operation.Type' is 'Update' and 'SimulateConcurrency' is 'true'.",
"description": "Defaults to 'Get'. Specify either just the method name (e.g. 'OperationName') or, interface and method name (e.g. 'IXxxManager.OperationName') to be invoked where in a different 'YyyManager.OperationName'."
},
"dataModel": {
"type": "boolean",
"title": "Indicates whether a data 'model' version of the entity should also be generated (output to '.\\Business\\Data\\Model').",
"description": "The model will be generated with 'OmitEntityBase = true'. Any reference data properties will be defined using their 'RefDataType' intrinsic 'Type' versus their corresponding (actual) reference data 'Type'."
},
"excludeEntity": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'Entity' class ('Xxx.cs')."
},
"excludeAll": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of all 'Operation' related artefacts; excluding the 'Entity' class.",
"description": "Is a shorthand means for setting all of the other 'Exclude*' properties (with the exception of 'ExcludeEntity') to exclude."
},
"excludeIData": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'Data' interface ('IXxxData.cs')."
},
"excludeData": {
"type": "string",
"title": "The option to exclude the generation of the 'Data' class ('XxxData.cs').",
"description": "Defaults to 'Include' indicating _not_ to exlude. A value of 'Exclude' indicates to exclude all output; alternatively, 'RequiresMapper' indicates to at least output the corresponding 'Mapper' class.",
"enum": [
"Include",
"Exclude",
"RequiresMapper"
]
},
"excludeIDataSvc": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'DataSvc' interface ('IXxxDataSvc.cs')."
},
"excludeDataSvc": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'DataSvc' class ('XxxDataSvc.cs')."
},
"excludeIManager": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'Manager' interface ('IXxxManager.cs')."
},
"excludeManager": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the 'Manager' class ('XxxManager.cs')."
},
"excludeWebApi": {
"type": "boolean",
"title": "The option to exclude the generation of the WebAPI 'Controller' class ('XxxController.cs')."
},
"excludeWebApiAgent": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the WebAPI consuming 'Agent' class ('XxxAgent.cs')."
},
"excludeGrpcAgent": {
"type": "boolean",
"title": "Indicates whether to exclude the generation of the gRPC consuming 'Agent' class ('XxxAgent.cs')."
},
"authRole": {
"type": "string",
"title": "The role (permission) used by the 'ExecutionContext.IsInRole(role)' for each 'Operation'.",
"description": "Used where not overridden specifically for an 'Operation'; i.e. acts as the default."
},
"grpc": {
"type": "boolean",
"title": "Indicates whether gRPC support (more specifically service-side) is required for the Entity.",
"description": "gRPC support is an explicit opt-in model (see 'CodeGeneration.Grpc' configuration); therefore, each corresponding 'Property' and 'Operation' will also need to be opted-in specifically."
},
"properties": {
"type": "array",
"title": "The corresponding 'Property' collection.",
"items": {
"$ref": "#/definitions/Property"
}
},
"operations": {
"type": "array",
"title": "The corresponding 'Operation' collection.",
"items": {
"$ref": "#/definitions/Operation"
}
},
"consts": {
"type": "array",
"title": "The corresponding 'Consts' collection.",
"items": {
"$ref": "#/definitions/Const"
}
}
},
"required": [
"name"
]
},
"Property": {
"type": "object",
"title": "'Property' object (entity-driven)",
"description": "The 'Property' object defines an 'Entity' property and its charateristics.",
"properties": {
"name": {
"type": "string",
"title": "The unique property name."
},
"text": {
"type": "string",
"title": "The overriding text for use in comments.",
"description": "By default the 'Text' will be the 'Name' reformatted as sentence casing. Depending on whether the 'Type' is 'bool', will appear in one of the two generated sentences. Where not 'bool' it will be: Gets or sets a value indicating whether {text}.'. Otherwise, it will be: Gets or sets the {text}.'. To create a '<see cref=\"XXX\"/>' within use moustache shorthand (e.g. {{Xxx}})."
},
"modelText": {
"type": "string",
"title": "The overriding model text for use in comments.",
"description": "By default the 'ModelText' will be the 'Name' reformatted as sentence casing. Depending on whether the 'Type' is 'bool', will appear in one of the two generated sentences. Where not 'bool' it will be: Gets or sets a value indicating whether {text}.'. Otherwise, it will be: Gets or sets the {text}.'. To create a '<see cref=\"XXX\"/>' within use moustache shorthand (e.g. {{Xxx}})."
},
"type": {
"type": "string",
"title": "The .NET 'Type'.",
"description": "Defaults to 'string'. To reference a Reference Data 'Type' always prefix with 'RefDataNamespace' (e.g. 'RefDataNamespace.Gender') or shortcut '^' (e.g. '^Gender'). This will ensure that the appropriate Reference Data 'using' statement is used. _Shortcut:_ Where the 'Type' starts with (prefix) 'RefDataNamespace.' or '^', and the correspondong 'RefDataType' attribute is not specified it will automatically default the 'RefDataType' to 'string.'"
},
"nullable": {
"type": "boolean",
"title": "Indicates whether the .NET 'Type' should be declared as nullable; e.g. 'string?'. Will be inferred where the 'Type' is denoted as nullable; i.e. suffixed by a '?'."
},
"inherited": {
"type": "boolean",
"title": "Indicates whether the property is inherited and therefore should not be output within the generated Entity class."
},
"privateName": {
"type": "string",
"title": "The overriding private name.",
"description": "Overrides the 'Name' to be used for private fields. By default reformatted from 'Name'; e.g. 'FirstName' as '_firstName'."
},
"argumentName": {
"type": "string",
"title": "The overriding argument name.",
"description": "Overrides the 'Name' to be used for argument parameters. By default reformatted from 'Name'; e.g. 'FirstName' as 'firstName'."
},
"uniqueKey": {
"type": "boolean",
"title": "Indicates whether the property is considered part of the unique (primary) key.",
"description": "This is also used to simplify the parameter specification for an Entity Operation by inferrence."
},
"isEntity": {
"type": "boolean",
"title": "Indicates that the property 'Type' is another generated entity / collection and therefore specific capabilities can be assumed (e.g. 'CopyFrom' and 'Clone').",
"description": "Will be inferred (default to 'true') where the 'Type' is 'ChangeLog' or the 'Type' is found as another 'Entity' within the code-generation configuration file."
},
"immutable": {
"type": "boolean",
"title": "Indicates that the value is immutable and therefore cannot be changed once set."
},
"dateTimeTransform": {
"type": "string",
"title": "The 'DateTime' transformation to be performed on 'Set' and 'CleanUp'.",
"description": "Defaults to 'UseDefault'. This is only applied where the 'Type' is 'DateTime'.",
"enum": [
"UseDefault",
"None",
"DateOnly",
"DateTimeLocal",
"DateTimeUtc",
"DateTimeUnspecified"
]
},
"stringTrim": {
"type": "string",
"title": "The 'string' trimming of white space characters to be performed on 'Set' and 'CleanUp'.",
"description": "Defaults to 'UseDefault'. This is only applied where the 'Type' is 'string'.",
"enum": [
"UseDefault",
"None",
"Start",
"End",
"Both"
]