Skip to content

Optional params in stored procedures not producing methods with defaults, nullable, optional? #859

@nealculiner

Description

@nealculiner

Hello @sjh37,

I'm using the latest (3.10.0) and have a MS-SQL stored procedure such as below. Shouldn't params with default values in the sproc correspond to optional params in the C# method signature?

CREATE PROCEDURE [dbo].[Tokens_PrepareAuthRequest] 
	@UserId INT,
	@ClientId NVARCHAR(50),
	@StateObject NVARCHAR(50),
	@TokenProvider NVARCHAR(50) = 'FCV',
	@ReferringUrl NVARCHAR(max) = NULL,
	@ReferringSiteName NVARCHAR(50) = NULL,
	@CallbackUrl NVARCHAR(MAX) = NULL
AS

Generates:

int Tokens_PrepareAuthRequest(int? userId, string clientId, 
    string stateObject, string tokenProvider, string referringUrl,
    string referringSiteName, string callbackUrl);
Task<int> Tokens_PrepareAuthRequestAsync(int? userId, string clientId,
    string stateObject, string tokenProvider, string referringUrl,
    string referringSiteName, string callbackUrl,
    CancellationToken cancellationToken = default(CancellationToken));

Shouldn't it generate something like this?

Task<int> Tokens_PrepareAuthRequestAsync(int? userId, string clientId,
    string stateObject, string tokenProvider = "FCV", string? referringUrl,
    string? referringSiteName, string? callbackUrl,
    CancellationToken cancellationToken = default(CancellationToken));

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions