Skip to content

T4 templates. Stored procedure is ignored if "table type" parameter present #1451

Closed
@shnipov

Description

I have stored procedure in MS SQL 2016 with user-defined table type parameter.
It looks like this:

CREATE TYPE MyTableType AS TABLE
(
	MyTableId INT
)

CREATE PROC MyStoredProc (
	@Ids MyTableType READONLY
)
AS 
BEGIN
    SELECT 1 AS Result
END

This proc is ignored by t4 generator because of this condition:

where ps.Parameters.All(p => p.SchemaType != "table type")

I've managed to call procedure with this code:

var dataTable = new DataTable();
dataTable.Columns.Add("MyTableId", typeof(int));
dataTable.Rows.Add(1);
List<object> res = this.QueryProc<object>("MyStoredProc", new DataParameter("@Ids", dataTable)).ToList();

Is there any chance to support this scenerio in t4 templates?

Environment details

linq2db version: 2.5.4
Database Server: Sql Server 2016
Operating system: Windows 10
Framework version: .NET Framework 4.7.2

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions