Skip to content

Commit

Permalink
v5.16.0 (#260)
Browse files Browse the repository at this point in the history
* v5.16.0
- *Enhancement:* Database code-generation defaults to the use of [JSON](https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server)-serialized parameters versus UDT/TVP to minimize the need for additional database objects; specifically [User-Defined Types](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql) (UDT).
  - A new `CollectionType` property has been added to the code-generation configuration for query-based collection passing; supports `JSON` (default) and `UDT` (previous) values. Note that for JSON passing a `NVARCHAR(MAX)` type should be used.
  - A merge for a sub-collection would previously require a `UDT` to be created; this is now handled using JSON serialization, unless explicitly required (example YAML `udt: true, tvp: WorkHistory`).
- *Enhancement:* The out-of-the-box _Beef_ `Type` schema objects (`udtBigIntList.sql`, `udtDateTimeList.sql`, `udtIntList.sql`, `udtNVarCharList.sql` and `udtUniqueIdentifierList.sql`) have been removed and will not be automatically included. Where required, these should be manually added to the database project and managed accordingly; use this [`create-beef-user-defined-types.sql`](./tools/Beef.Database.SqlServer/Migrations/create-beef-user-defined-types.sql) migration script to add.
- *Enhancement:* All code-generated SQL objects have been updated to support replacement, for example `CREATE OR ALTER` versus previous `CREATE`; this potentially minimizes the need to drop and recreate each migration. This _DbEx_ behavior is predicated on not having any `Type` (UDT) schema objects which do not support replacement. It is also therefore recommended that all non-generated schema objects support replacement as they all have to adhere to this pattern to avoid unnecessary dropping.
  • Loading branch information
chullybun authored Oct 2, 2024
1 parent 3679f5d commit 7e70917
Show file tree
Hide file tree
Showing 147 changed files with 758 additions and 440 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,13 @@ jobs:
- name: Template/SqlServer/EfWs create
run: dotnet new beef --company Foo.EfWs --appname Bar --datasource SqlServer --services AzFunction --output Foo.EfWs.Bar

- name: Template/SqlServer/EfWs database
- name: Template/SqlServer/EfWs database drop
working-directory: ./Foo.EfWs.Bar/Foo.EfWs.Bar.Database
run: dotnet run dropandall --connection-varname Bar_ConnectionStrings__Database --accept-prompts
run: dotnet run drop --connection-varname Bar_ConnectionStrings__Database --accept-prompts

- name: Template/SqlServer/EfWs database create-migrate-codegen
working-directory: ./Foo.EfWs.Bar/Foo.EfWs.Bar.Database
run: dotnet run createmigrateandcodegen --connection-varname Bar_ConnectionStrings__Database --accept-prompts

- name: Template/SqlServer/EfWs code-gen
working-directory: ./Foo.EfWs.Bar/Foo.EfWs.Bar.CodeGen
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

Represents the **NuGet** versions.

## v5.16.0
- *Enhancement:* Database code-generation defaults to the use of [JSON](https://learn.microsoft.com/en-us/sql/relational-databases/json/json-data-sql-server)-serialized parameters versus UDT/TVP to minimize the need for additional database objects; specifically [User-Defined Types](https://learn.microsoft.com/en-us/sql/t-sql/statements/create-type-transact-sql) (UDT).
- A new `CollectionType` property has been added to the code-generation configuration for query-based collection passing; supports `JSON` (default) and `UDT` (previous) values. Note that for JSON passing a `NVARCHAR(MAX)` type should be used.
- A merge for a sub-collection would previously require a `UDT` to be created; this is now handled using JSON serialization, unless explicitly required (example YAML `udt: true, tvp: WorkHistory`).
- *Enhancement:* The out-of-the-box _Beef_ `Type` schema objects (`udtBigIntList.sql`, `udtDateTimeList.sql`, `udtIntList.sql`, `udtNVarCharList.sql` and `udtUniqueIdentifierList.sql`) have been removed and will not be automatically included. Where required, these should be manually added to the database project and managed accordingly; use this [`create-beef-user-defined-types.sql`](./tools/Beef.Database.SqlServer/Migrations/create-beef-user-defined-types.sql) migration script to add.
- *Enhancement:* All code-generated SQL objects have been updated to support replacement, for example `CREATE OR ALTER` versus previous `CREATE`; this potentially minimizes the need to drop and recreate each migration. This _DbEx_ behavior is predicated on not having any `Type` (UDT) schema objects which do not support replacement. It is also therefore recommended that all non-generated schema objects support replacement as they all have to adhere to this pattern to avoid unncessary dropping.

## v5.15.2
- *Fixed:* Fixed the event value publish code-generation by enabling an override using `Operation.EventValue` where applicable (i.e. no response).

Expand Down
2 changes: 1 addition & 1 deletion Common.targets
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project>
<PropertyGroup>
<Version>5.15.2</Version>
<Version>5.16.0</Version>
<LangVersion>preview</LangVersion>
<Authors>Avanade</Authors>
<Company>Avanade</Company>
Expand Down
1 change: 1 addition & 0 deletions docs/Database-CodeGeneration-Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ Property | Description
-|-
`autoDotNetRename` | The option to automatically rename the SQL Tables and Columns for use in .NET. Valid options are: `None`, `PascalCase`, `SnakeKebabToPascalCase`.<br/>&dagger; Defaults `SnakeKebabToPascalCase` that will remove any underscores or hyphens separating each word and capitalize the first character of each; e.g. `internal-customer_id` would be renamed as `InternalCustomerId`. The `PascalCase` option will capatilize the first character only.
`preprocessorDirectives` | Indicates whether to use preprocessor directives in the generated output.
**`collectionType`** | The collection type. Valid options are: `JSON`, `UDT`.<br/>&dagger; Values are `JSON` being a JSON array (preferred) or `UDT` for a User-Defined Type (legacy). Defaults to `JSON`.

<br/>

Expand Down
1 change: 1 addition & 0 deletions docs/Database-Parameter-Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ Property | Description
`nullable` | Indicates whether the parameter is nullable.<br/>&dagger; Note that when the parameter value is `NULL` it will not be included in the query.
`treatColumnNullAs` | Indicates whether the column value where NULL should be treated as the specified value; results in: `ISNULL([x].[col], value)`.
`collection` | Indicates whether the parameter is a collection (one or more values to be included `IN` the query).
**`collectionType`** | The collection type. Valid options are: `JSON`, `UDT`.<br/>&dagger; Values are `JSON` being a JSON array (preferred) or `UDT` for a User-Defined Type (legacy). Defaults to `StoredProcedure.CollectionType`.
**`operator`** | The where clause equality operator Valid options are: `EQ`, `NE`, `LT`, `LE`, `GT`, `GE`, `LIKE`.<br/>&dagger; Defaults to `EQ`.

1 change: 1 addition & 0 deletions docs/Database-StoredProcedure-Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ Property | Description
`reselectStatement` | The SQL statement to perform the reselect after a `Create`, `Update` or `Upsert` stored procedure operation `Type`.<br/>&dagger; Defaults to `[{{Table.Schema}}].[sp{{Table.Name}}Get]` passing the primary key column(s).
`intoTempTable` | Indicates whether to select into a `#TempTable` to allow other statements access to the selected data.<br/>&dagger; A `Select * from #TempTable` is also performed (code-generated) where the stored procedure operation `Type` is `GetColl`.
`withHints` | the table hints using the SQL Server `WITH()` statement; the value specified will be used as-is; e.g. `NOLOCK` will result in `WITH(NOLOCK)`.
**`collectionType`** | The collection type. Valid options are: `JSON`, `UDT`.<br/>&dagger; Values are `JSON` being a JSON array (preferred) or `UDT` for a User-Defined Type (legacy). Defaults to `Table.CollectionType`.

<br/>

Expand Down
2 changes: 2 additions & 0 deletions docs/Database-Table-Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ Property | Description
**`includeColumns`** | The list of `Column` names to be included in the underlying generated output.<br/>&dagger; Where not specified this indicates that all `Columns` are to be included.
**`excludeColumns`** | The list of `Column` names to be excluded from the underlying generated output.<br/>&dagger; Where not specified this indicates no `Columns` are to be excluded.
**`aliasColumns`** | The list of `Column` and `Alias` pairs (split by a `^` lookup character) to enable column aliasing/renaming.<br/>&dagger; Each alias value should be formatted as `Column` + `^` + `Alias`; e.g. `PCODE^ProductCode`.
**`jsonAliasColumns`** | The list of JSON `Column` and `JsonAlias` pairs (split by a `^` lookup character) to enable column aliasing/renaming.<br/>&dagger; Each alias value should be formatted as `Column` + `^` + `Alias`; e.g. `ProductCode^product`.

<br/>

Expand Down Expand Up @@ -111,6 +112,7 @@ Property | Description
**`udt`** | Indicates whether a `User Defined Table (UDT)` type should be created.
`udtExcludeColumns` | The list of `Column` names to be excluded from the `User Defined Table (UDT)`.<br/>&dagger; Where not specified this indicates that no `Columns` are to be excluded.
**`tvp`** | The name of the .NET entity associated with the `Udt` so that it can be expressed (created) as a Table-Valued Parameter for usage within the corresponding `DbMapper`.
**`collectionType`** | The collection type. Valid options are: `JSON`, `UDT`.<br/>&dagger; Values are `JSON` being a JSON array (preferred) or `UDT` for a User-Defined Type (legacy). Defaults to `Config.CollectionType`.

<br/>

Expand Down
4 changes: 2 additions & 2 deletions samples/Cdr.Banking/Cdr.Banking.Api/Cdr.Banking.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<ImplicitUsings>true</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.5" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.8.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.6" />
<PackageReference Include="Swashbuckle.AspNetCore.SwaggerGen" Version="6.8.1" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Cdr.Banking.Business\Cdr.Banking.Business.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<Folder Include="DataSvc\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.5" />
<PackageReference Include="CoreEx.Cosmos" Version="3.25.5" />
<PackageReference Include="CoreEx.Validation" Version="3.25.5" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.6" />
<PackageReference Include="CoreEx.Cosmos" Version="3.25.6" />
<PackageReference Include="CoreEx.Validation" Version="3.25.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<Folder Include="Entities\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.25.5" />
<PackageReference Include="CoreEx" Version="3.25.6" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.25.5" />
<PackageReference Include="CoreEx.UnitTesting.NUnit" Version="3.25.6" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions samples/Demo/Beef.Demo.Api/Beef.Demo.Api.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.5" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.0" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.8.0" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.6" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.8.1" />
<PackageReference Include="Swashbuckle.AspNetCore.Newtonsoft" Version="6.8.1" />
</ItemGroup>

<ItemGroup>
Expand Down
16 changes: 8 additions & 8 deletions samples/Demo/Beef.Demo.Business/Beef.Demo.Business.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CoreEx" Version="3.25.5" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.5" />
<PackageReference Include="CoreEx.Cosmos" Version="3.25.5" />
<PackageReference Include="CoreEx.Database" Version="3.25.5" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.25.5" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.25.5" />
<PackageReference Include="CoreEx.Validation" Version="3.25.5" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.25.5" />
<PackageReference Include="CoreEx" Version="3.25.6" />
<PackageReference Include="CoreEx.AspNetCore" Version="3.25.6" />
<PackageReference Include="CoreEx.Cosmos" Version="3.25.6" />
<PackageReference Include="CoreEx.Database" Version="3.25.6" />
<PackageReference Include="CoreEx.Database.SqlServer" Version="3.25.6" />
<PackageReference Include="CoreEx.EntityFrameworkCore" Version="3.25.6" />
<PackageReference Include="CoreEx.Validation" Version="3.25.6" />
<PackageReference Include="CoreEx.FluentValidation" Version="3.25.6" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="6.0.20" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ namespace Beef.Demo.Business.Data;
/// <param name="logger">The <see cref="ILogger"/>.</param>
public sealed class EventOutboxEnqueue(IDatabase database, ILogger<EventOutboxEnqueue> logger) : EventOutboxEnqueueBase(database, logger)
{
/// <inheritdoc/>
protected override string DbTvpTypeName => "[Outbox].[udtEventOutboxList]";

/// <inheritdoc/>
protected override string EnqueueStoredProcedure => "[Outbox].[spEventOutboxEnqueue]";
}
2 changes: 1 addition & 1 deletion samples/Demo/Beef.Demo.Business/Data/PersonData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ private void GetByArgsOnQuery(DatabaseParameterCollection p, PersonArgs? args)
{
p.ParamWithWildcard(args?.FirstName, "FirstName")
.ParamWithWildcard(args?.LastName, "LastName")
.TableValuedParamWith(args?.Genders, "GenderIds", () => _db.CreateTableValuedParameter(args!.Genders!.ToIdList<Guid>()));
.JsonParamWith(args?.Genders, "GenderIds", () => args!.Genders!.ToIdList<Guid>());
}

private IQueryable<EfModel.Person> GetByArgsWithEfOnQuery(IQueryable<EfModel.Person> q, PersonArgs? args)
Expand Down
2 changes: 1 addition & 1 deletion samples/Demo/Beef.Demo.Common/Beef.Demo.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Folder Include="Agents\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="CoreEx" Version="3.25.5" />
<PackageReference Include="CoreEx" Version="3.25.6" />
<PackageReference Include="Grpc.Tools" Version="2.66.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
Expand Down
4 changes: 4 additions & 0 deletions samples/Demo/Beef.Demo.Database/Beef.Demo.Database.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
<EmbeddedResource Include="Data\**\*" />
</ItemGroup>

<ItemGroup>
<None Remove="migrations\20241002-085013-create-beef-user-defined-types.sql" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\tools\Beef.Database.Core\Beef.Database.Core.csproj" />
<ProjectReference Include="..\..\..\tools\Beef.Database.SqlServer\Beef.Database.SqlServer.csproj" />
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-- Copyright (c) Avanade. Licensed under the MIT License. See https://github.com/Avanade/Beef

IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtBigIntList' AND is_user_defined = 1)
BEGIN
CREATE TYPE [dbo].[udtBigIntList] AS TABLE
(
[Value] BIGINT
)
END

IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtDateTime2List' AND is_user_defined = 1)
BEGIN
CREATE TYPE [dbo].[udtDateTime2List] AS TABLE
(
[Value] DATETIME2
)
END

IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtIntList' AND is_user_defined = 1)
BEGIN
CREATE TYPE [dbo].[udtIntList] AS TABLE
(
[Value] INT
)
END

IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtNVarCharList' AND is_user_defined = 1)
BEGIN
CREATE TYPE [dbo].[udtNVarCharList] AS TABLE
(
[Value] NVARCHAR(MAX)
)
END

IF NOT EXISTS (SELECT * FROM sys.types WHERE name = 'udtUniqueIdentifierList' AND is_user_defined = 1)
BEGIN
CREATE TYPE [dbo].[udtUniqueIdentifierList] AS TABLE
(
[Value] UNIQUEIDENTIFIER
)
END
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"Beef.Demo.Database": {
"commandName": "Project",
"commandLineArgs": "data"
"commandLineArgs": "codegen"
}
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2Create]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2Create]
@PersonId AS UNIQUEIDENTIFIER = NULL OUTPUT,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2Delete]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2Delete]
@PersonId AS UNIQUEIDENTIFIER,
@UpdatedBy AS NVARCHAR(250) NULL = NULL,
@UpdatedDate AS DATETIME2 NULL = NULL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2Get]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2Get]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2GetAll]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2GetAll]
AS
BEGIN
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2Update]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2Update]
@PersonId AS UNIQUEIDENTIFIER,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPerson2Upsert]
CREATE OR ALTER PROCEDURE [Demo].[spPerson2Upsert]
@PersonId AS UNIQUEIDENTIFIER,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonCreate]
CREATE OR ALTER PROCEDURE [Demo].[spPersonCreate]
@PersonId AS UNIQUEIDENTIFIER = NULL OUTPUT,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonDelete]
CREATE OR ALTER PROCEDURE [Demo].[spPersonDelete]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonGet]
CREATE OR ALTER PROCEDURE [Demo].[spPersonGet]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonGetAll]
CREATE OR ALTER PROCEDURE [Demo].[spPersonGetAll]
@PagingSkip AS INT = 0,
@PagingTake AS INT = 250,
@PagingCount AS BIT = NULL
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
CREATE PROCEDURE [Demo].[spPersonGetByArgs]
CREATE OR ALTER PROCEDURE [Demo].[spPersonGetByArgs]
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
@GenderIds AS [dbo].[udtUniqueIdentifierList] READONLY,
@GenderIds AS NVARCHAR(MAX) NULL = NULL, -- JSON Array
@PagingSkip AS INT = 0,
@PagingTake AS INT = 250,
@PagingCount AS BIT = NULL
Expand All @@ -15,7 +15,7 @@ BEGIN

-- Check list counts.
DECLARE @GenderIdsCount AS INT
SET @GenderIdsCount = (SELECT COUNT(*) FROM @GenderIds)
SET @GenderIdsCount = (SELECT COUNT(*) FROM OPENJSON(@GenderIds))

-- Select the requested data.
SELECT
Expand All @@ -37,7 +37,7 @@ BEGIN
FROM [Demo].[Person] AS [p]
WHERE (@FirstName IS NULL OR [p].[FirstName] LIKE @FirstName)
AND (@LastName IS NULL OR [p].[LastName] LIKE @LastName)
AND (@GenderIdsCount = 0 OR [p].[GenderId] IN (SELECT [Value] FROM @GenderIds))
AND (@GenderIdsCount = 0 OR [p].[GenderId] IN (SELECT VALUE FROM OPENJSON(@GenderIds)))
ORDER BY [p].[LastName] ASC, [p].[FirstName] ASC
OFFSET @PagingSkip ROWS FETCH NEXT @PagingTake ROWS ONLY

Expand All @@ -48,6 +48,6 @@ BEGIN
FROM [Demo].[Person] AS [p]
WHERE (@FirstName IS NULL OR [p].[FirstName] LIKE @FirstName)
AND (@LastName IS NULL OR [p].[LastName] LIKE @LastName)
AND (@GenderIdsCount = 0 OR [p].[GenderId] IN (SELECT [Value] FROM @GenderIds)))
AND (@GenderIdsCount = 0 OR [p].[GenderId] IN (SELECT VALUE FROM OPENJSON(@GenderIds))))
END
END
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonGetDetail]
CREATE OR ALTER PROCEDURE [Demo].[spPersonGetDetail]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonGetDetailByArgs]
CREATE OR ALTER PROCEDURE [Demo].[spPersonGetDetailByArgs]
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
@GenderIds AS [dbo].[udtUniqueIdentifierList] READONLY,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonUpdate]
CREATE OR ALTER PROCEDURE [Demo].[spPersonUpdate]
@PersonId AS UNIQUEIDENTIFIER,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spPersonUpdateDetail]
CREATE OR ALTER PROCEDURE [Demo].[spPersonUpdateDetail]
@PersonId AS UNIQUEIDENTIFIER,
@FirstName AS NVARCHAR(50) NULL = NULL,
@LastName AS NVARCHAR(50) NULL = NULL,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spWorkHistoryGetByPersonId]
CREATE OR ALTER PROCEDURE [Demo].[spWorkHistoryGetByPersonId]
@PersonId AS UNIQUEIDENTIFIER
AS
BEGIN
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spWorkHistoryGetUsingTempTable]
CREATE OR ALTER PROCEDURE [Demo].[spWorkHistoryGetUsingTempTable]
AS
BEGIN
/*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Demo].[spWorkHistoryMerge]
CREATE OR ALTER PROCEDURE [Demo].[spWorkHistoryMerge]
@PersonId AS UNIQUEIDENTIFIER,
@List AS [Demo].[udtWorkHistoryList] READONLY
AS
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
CREATE PROCEDURE [Outbox].[spEventOutboxDequeue]
CREATE OR ALTER PROCEDURE [Outbox].[spEventOutboxDequeue]
@MaxDequeueSize INT = 10, -- Maximum number of events to dequeue.
@PartitionKey NVARCHAR(127) NULL = NULL, -- Partition key; null indicates all.
@Destination NVARCHAR(127) NULL = NULL -- Destination (queue or topic); null indicates all.
Expand Down
Loading

0 comments on commit 7e70917

Please sign in to comment.