You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* v5.15.0
Enhancement: Added Operation.Query boolean to enable support for OData-like query syntax. This leverages the underlying CoreEx.Data.Querying capabilities to enable. The Operation.Behavior has also been extened to support a 'Q'uery as a shorthand to enable a query operation.
Enhancement: Updated the DatabaseName, EntityFrameworkName, CosmosName, ODataName and HttpAgentName to support both Type (existing) and optional Name (new). This uses the Type^Name syntax supported for other properties with similar purpose. The properties have also had the Name suffix renamed to Type as this more accurately reflects the property intent (existing names will continue to work with a corresponding warning during code-generation).
* Add missing Cosmos template CI test
* Fix cosmos template.
* Tweaks and fixes.
Copy file name to clipboardexpand all lines: CHANGELOG.md
+4
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
Represents the **NuGet** versions.
4
4
5
+
## v5.15.0
6
+
-*Enhancement:* Added `Operation.Query` boolean to enable support for OData-like query syntax. This leverages the underlying `CoreEx.Data.Querying` (`v3.25.1+`) capabilities to enable. The `Operation.Behavior` has also been extended to support a '`Q`'uery as a shorthand to enable a query-based operation. _Note:_ this is an **awesome** new capability.
7
+
-*Enhancement:* Updated the `DatabaseName`, `EntityFrameworkName`, `CosmosName`, `ODataName` and `HttpAgentName` to support both `Type` (existing) and optional `Name` (new). This uses the `Type^Name` syntax supported for other properties with similar purpose. The properties have also had the `Name` suffix renamed to `Type` as this more accurately reflects the property intent (existing names will continue to work with a corresponding warning during code-generation).
8
+
5
9
## v5.14.2
6
10
-*Fixed:* Fixed the data model code-generation to output the `PartitionKey` where specified.
7
11
-*Fixed:* Fixed the code-generated `PartitionKey` to be a nullable string.
Copy file name to clipboardexpand all lines: docs/Entity-CodeGeneration-Config.md
+5-5
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ Provides the _Database Data-layer_ configuration.
135
135
136
136
Property | Description
137
137
-|-
138
-
**`databaseName`** | The .NET database interface name (used where `Operation.AutoImplement` is `Database`).<br/>† Defaults to `IDatabase`. This can be overridden within the `Entity`(s).
138
+
**`databaseType`** | The .NET database type and optional name (used where `Operation.AutoImplement` is `Database`).<br/>† Defaults to `IDatabase`. Should be formatted as `Type` + `^` + `Name`; e.g. `IDatabase^Db`. Where the `Name` portion is not specified it will be inferred. This can be overridden within the `Entity`(s).
139
139
**`databaseSchema`** | The default database schema name.<br/>† Defaults to `dbo`.
140
140
**`databaseProvider`** | The default database schema name. Valid options are: `SqlServer`, `MySQL`, `Postgres`.<br/>† Defaults to `SqlServer`. Enables specific database provider functionality/formatting/etc. where applicable.
141
141
`databaseMapperEx`| Indicates that a `DatabaseMapperEx` will be used; versus, `DatabaseMapper` (which uses Reflection internally).<br/>† Defaults to `true`. The `DatabaseMapperEx` essentially replaces the `DatabaseMapper` as it is more performant (extended/explicit); this option can be used where leagcy/existing behavior is required.
`entityFrameworkName`| The .NET Entity Framework interface name used where `Operation.AutoImplement` is `EntityFramework`.<br/>† Defaults to `IEfDb`. This can be overridden within the `Entity`(s).
150
+
`entityFrameworkType`| The .NET Entity Framework type and optional name (used where `Operation.AutoImplement` is `EntityFramework`).<br/>† Defaults to `IEfDb`. Should be formatted as `Type` + `^` + `Name`; e.g. `IEfDb^Ef`. Where the `Name` portion is not specified it will be inferred. This can be overridden within the `Entity`(s).
151
151
152
152
<br/>
153
153
@@ -156,7 +156,7 @@ Provides the _CosmosDB Data-layer_ configuration.
156
156
157
157
Property | Description
158
158
-|-
159
-
**`cosmosName`** | The .NET Entity Framework interface name used where `Operation.AutoImplement` is `Cosmos`.<br/>† Defaults to `ICosmosDb`. This can be overridden within the `Entity`(s).
159
+
**`cosmosType`** | The .NET Cosmos DB type and name (used where `Operation.AutoImplement` is `Cosmos`).<br/>† Defaults to `ICosmosDb`. Should be formatted as `Type` + `^` + `Name`; e.g. `ICosmosDb^Cosmos`. Where the `Name` portion is not specified it will be inferred. This can be overridden within the `Entity`(s).
160
160
161
161
<br/>
162
162
@@ -165,7 +165,7 @@ Provides the _OData Data-layer_ configuration.
165
165
166
166
Property | Description
167
167
-|-
168
-
**`odataName`** | The .NET OData interface name used where `Operation.AutoImplement` is `OData`.<br/>† Defaults to `IOData`. This can be overridden within the `Entity`(s).
168
+
**`odataType`** | The .NET OData interface name used where `Operation.AutoImplement` is `OData`.<br/>† Defaults to `IOData`. Should be formatted as `Type` + `^` + `Name`; e.g. `IOData^OData`. Where the `Name` portion is not specified it will be inferred. This can be overridden within the `Entity`(s).
169
169
170
170
<br/>
171
171
@@ -174,7 +174,7 @@ Provides the _HTTP Agent Data-layer_ configuration.
174
174
175
175
Property | Description
176
176
-|-
177
-
**`httpAgentName`** | The default .NET HTTP Agent interface name used where `Operation.AutoImplement` is `HttpAgent`.<br/>† Defaults to `IHttpAgent`. This can be overridden within the `Entity`(s).
177
+
**`httpAgentType`** | The default .NET HTTP Agent interface name used where `Operation.AutoImplement` is `HttpAgent`.<br/>† Defaults to `IHttpAgent`. Should be formatted as `Type` + `^` + `Name`; e.g. `IHttpAgent^HttpAgent`. Where the `Name` portion is not specified it will be inferred. This can be overridden within the `Entity`(s).
Copy file name to clipboardexpand all lines: docs/Entity-Entity-Config.md
+7-6
Original file line number
Diff line number
Diff line change
@@ -121,10 +121,11 @@ Provides the _Operation_ configuration. These primarily provide a shorthand to c
121
121
122
122
Property | Description
123
123
-|-
124
-
`behavior` | Defines the key CRUD-style behavior (operation types), being 'C'reate, 'G'et (or 'R'ead), 'U'pdate, 'P'atch and 'D'elete). Additionally, GetByArgs ('B') and GetAll ('A') operations that will be automatically generated where not otherwise explicitly specified.<br/>† Value may only specifiy one or more of the `CGRUDBA` characters (in any order) to define the automatically generated behavior (operations); for example: `CRUPD`or `CRUP` or `rba` (case insensitive). This is shorthand for setting one or more of the following properties: `Get`, `GetByArgs`, `GetAll`, 'Create', `Update`, `Patch` and `Delete`. Where one of these properties is set to either `true` or `false` this will take precedence over the value set for `Behavior`.
124
+
`behavior` | Defines the key CRUD-style behavior (operation types), being 'C'reate, 'G'et (or 'R'ead), 'U'pdate, 'P'atch, 'D'elete and `Q`uery). Additionally, `GetByArgs` ('B'), `GetAll` ('A') and `GetByQuery` ('Q') operations configuration will be automatically inferred where not otherwise explicitly specified.<br/>† Value may only specifiy one or more of the `CGRUDBAQ` characters (in any order) to define the automatically generated behavior (operations); for example: `CRUPD`or `CRUP` or `rba` (case insensitive). This is shorthand for setting one or more of the following properties: `Get`, `GetByArgs`, `GetAll`, 'Create', `Update`, `Patch` and `Delete`. Where one of these properties is set to either `true` or `false` this will take precedence over the value set for `Behavior`.
125
125
`get`| Indicates that a `Get` operation will be automatically generated where not otherwise explicitly specified.
126
126
`getByArgs`| Indicates that a `GetByArgs` operation will be automatically generated where not otherwise explicitly specified.
127
127
`getAll`| Indicates that a `GetAll` operation will be automatically generated where not otherwise explicitly specified.
128
+
`getByQuery`| Indicates that a `GetByQuery` operation will be automatically generated where not otherwise explicitly specified.
128
129
`create`| Indicates that a `Create` operation will be automatically generated where not otherwise explicitly specified.
129
130
`update`| Indicates that a `Update` operation will be automatically generated where not otherwise explicitly specified.
130
131
`patch`| Indicates that a `Patch` operation will be automatically generated where not otherwise explicitly specified.
@@ -217,7 +218,7 @@ Provides the specific _Database (ADO.NET)_ configuration where `AutoImplement` i
217
218
218
219
Property | Description
219
220
-|-
220
-
**`databaseName`** | The .NET database interface name (used where `AutoImplement` is `Database`).<br/>† Defaults to the `CodeGeneration.DatabaseName` configuration property (its default value is `IDatabase`).
221
+
**`databaseType`** | The .NET database type and optional name (used where `AutoImplement` is `Database`).<br/>† Defaults to the `CodeGeneration.DatabaseName` configuration property (its default value is `IDatabase`). Should be formatted as `Type` + `^` + `Name`.
221
222
**`databaseSchema`** | The database schema name (used where `AutoImplement` is `Database`).<br/>† Defaults to `dbo`.
222
223
`databaseMapperInheritsFrom`| The name of the `Mapper` that the generated Database `Mapper` inherits from.
223
224
`databaseCustomMapper`| Indicates that a custom Database `Mapper` will be used; i.e. not generated.<br/>† Otherwise, by default, a `Mapper` will be generated.
@@ -230,7 +231,7 @@ Provides the specific _Entity Framework (EF)_ configuration where `AutoImplement
230
231
231
232
Property | Description
232
233
-|-
233
-
**`entityFrameworkName`** | The .NET Entity Framework interface name used where `AutoImplement` is `EntityFramework`.<br/>† Defaults to `CodeGeneration.EntityFrameworkName`.
234
+
**`entityFrameworkType`** | The .NET Entity Framework type and optyional name used where `AutoImplement` is `EntityFramework`.<br/>† Defaults to `CodeGeneration.EntityFrameworkName`. Should be formatted as `Type` + `^` + `Name`.
234
235
**`entityFrameworkModel`** | The corresponding Entity Framework model name (required where `AutoImplement` is `EntityFramework`).
235
236
`entityFrameworkCustomMapper`| Indicates that a custom Entity Framework `Mapper` will be used; i.e. not generated.<br/>† Otherwise, by default, a `Mapper` will be generated.
236
237
`entityFrameworkMapperBase`| The EntityFramework data-layer name that should be used for base mappings.
@@ -242,7 +243,7 @@ Provides the specific _Cosmos_ configuration where `AutoImplement` is `Cosmos`.
242
243
243
244
Property | Description
244
245
-|-
245
-
**`cosmosName`** | The .NET Cosmos interface name used where `AutoImplement` is `Cosmos`.<br/>† Defaults to the `CodeGeneration.CosmosName` configuration property (its default value is `ICosmosDb`).
246
+
**`cosmosType`** | The .NET Cosmos DB type and optional name used where `AutoImplement` is `Cosmos`.<br/>† Defaults to the `CodeGeneration.CosmosName` configuration property (its default value is `ICosmosDb`). Should be formatted as `Type` + `^` + `Name`.
246
247
**`cosmosModel`** | The corresponding Cosmos model name (required where `AutoImplement` is `Cosmos`).
247
248
**`cosmosContainerId`** | The Cosmos `ContainerId` required where `AutoImplement` is `Cosmos`.
248
249
`cosmosPartitionKey`| The C# code to be used for setting the optional Cosmos `PartitionKey` where `AutoImplement` is `Cosmos`.<br/>† The value `PartitionKey.None` can be specified. Literals will need to be quoted.
@@ -258,7 +259,7 @@ Provides the specific _OData_ configuration where `AutoImplement` is `OData`.
258
259
259
260
Property | Description
260
261
-|-
261
-
**`odataName`** | The .NET OData interface name used where `AutoImplement` is `OData`.<br/>† Defaults to the `CodeGeneration.ODataName` configuration property (its default value is `IOData`).
262
+
**`odataType`** | The .NET OData type and optional name used where `AutoImplement` is `OData`.<br/>† Defaults to the `CodeGeneration.ODataName` configuration property (its default value is `IOData`). Should be formatted as `Type` + `^` + `Name`.
262
263
**`odataModel`** | The corresponding OData model name (required where `AutoImplement` is `OData`).
263
264
**`odataCollectionName`** | The name of the underlying OData collection where `AutoImplement` is `OData`.<br/>† The underlying `Simple.OData.Client` will attempt to infer.
264
265
`odataCustomMapper`| Indicates that a custom OData `Mapper` will be used; i.e. not generated.<br/>† Otherwise, by default, a `Mapper` will be generated.
@@ -271,7 +272,7 @@ Provides the specific _HTTP Agent_ configuration where `AutoImplement` is `HttpA
271
272
272
273
Property | Description
273
274
-|-
274
-
**`httpAgentName`** | The .NET HTTP Agent interface name used where `Operation.AutoImplement` is `HttpAgent`.<br/>† Defaults to `CodeGeneration.HttpAgentName` configuration property (its default value is `IHttpAgent`).
275
+
**`httpAgentType`** | The .NET HTTP Agent type and optional name used where `Operation.AutoImplement` is `HttpAgent`.<br/>† Defaults to `CodeGeneration.HttpAgentName` configuration property (its default value is `IHttpAgent`). Should be formatted as `Type` + `^` + `Name`.
275
276
`httpAgentRoutePrefix`| The base HTTP Agent API route where `Operation.AutoImplement` is `HttpAgent`.<br/>† This is the base (prefix) `URI` for the HTTP Agent endpoint and can be further extended when defining the underlying `Operation`(s).
276
277
**`httpAgentModel`** | The corresponding HTTP Agent model name (required where `AutoImplement` is `HttpAgent`).<br/>† This can be overridden within the `Operation`(s).
277
278
`httpAgentReturnModel`| The corresponding HTTP Agent model name (required where `AutoImplement` is `HttpAgent`).<br/>† This can be overridden within the `Operation`(s).
Copy file name to clipboardexpand all lines: docs/Entity-Operation-Config.md
+1
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,7 @@ Property | Description
69
69
`text` | The text for use in comments.<br/>† The `Text` will be defaulted for all the `Operation.Type` options with the exception of `Custom`. To create a `<see cref="XXX"/>` within use moustache shorthand (e.g. {{Xxx}}). To have the text used as-is prefix with a `+` plus-sign character.
70
70
**`primaryKey`** | Indicates whether the properties marked as a primary key (`Property.PrimaryKey`) are to be used as the parameters.<br/>† This simplifies the specification of these properties as parameters versus having to declare each specifically. Each of the parameters will also be set to be mandatory.
71
71
**`paging`** | Indicates whether a `PagingArgs` argument is to be added to the operation to enable (standardized) paging related logic.
72
+
**`query`** | Indicates whether a `QueryArgs` argument is to be added to the operation to enable OData-like $filter and $orderby related logic.
72
73
`valueType` | The .NET value parameter `Type` for the operation.<br/>† Defaults to the parent `Entity.Name` where the `Operation.Type` options are `Create` or `Update`.
73
74
`returnType` | The .NET return `Type` for the operation.<br/>† Defaults to the parent `Entity.Name` where the `Operation.Type` options are `Get`, `GetColl`, `Create` or `Update`; otherwise, defaults to `void`.
74
75
`returnTypeNullable` | Indicates whether the `ReturnType` is nullable for the operation.<br/>† Will be inferred where the `ReturnType` is denoted as nullable; i.e. suffixed by a `?`. Additionally a `Type` of `Get` will default to `true` where not specified.
Copy file name to clipboardexpand all lines: samples/Cdr.Banking/Cdr.Banking.Api/Controllers/Generated/AccountController.cs
+13
Original file line number
Diff line number
Diff line change
@@ -43,6 +43,19 @@ public Task<IActionResult> GetAccounts([FromQuery(Name="product-category")] stri
43
43
return_webApi.GetWithResultAsync<AccountCollectionResult>(Request, p =>_manager.GetAccountsAsync(args,p.RequestOptions.Paging),alternateStatusCode:HttpStatusCode.NoContent);
=>_webApi.GetWithResultAsync<AccountCollectionResult>(Request, p =>_manager.GetAccountsQueryAsync(p.RequestOptions.Query,p.RequestOptions.Paging),alternateStatusCode:HttpStatusCode.NoContent);
0 commit comments