Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Request, T4 template] Support for ParameterDirection.ReturnValue #1897

Closed
ig-sinicyn opened this issue Sep 23, 2019 · 2 comments · Fixed by #1905 or #3098
Closed

[Request, T4 template] Support for ParameterDirection.ReturnValue #1897

ig-sinicyn opened this issue Sep 23, 2019 · 2 comments · Fixed by #1905 or #3098
Assignees
Milestone

Comments

@ig-sinicyn
Copy link

ig-sinicyn commented Sep 23, 2019

Current version of l2db template has no support for return parameters.
Can you add an option like

Procedures["SomeProc"].UsesReturn = true;

?

Use case: we have a legacy MS SQL db with a lot of SPs that use RETURN someValue;.

We've workarounded it with c# helper methods that wrap QueryProc() calls but having such feature will be a real time-saver:)

Environment details

linq2db version: 2.9.0
Database Server: MS SQL 2017
Database Provider: System.Data.Sql
Operating system: Windows 10
Framework version: .NET Core 3

@sdanyliv
Copy link
Member

@MaceWindu, it looks like a bug. Please clarify. We have have to process at leas IsResult parameteter.
@ig-sinicyn, can you post sample of such procedure?

@ig-sinicyn
Copy link
Author

@sdanyliv it's not a bug, really. As example.

CREATE PROCEDURE dbo.GetRandomNumber
AS
BEGIN
	RETURN 4 -- chosen by fair dice roll.
                 -- guaranteed to be random.
END;

SP may use output parameter(s), result set(s) or result code. It's up to developer to specify which one should be treated as return value in generated code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants