Skip to content

Stored procedures not getting Async methods generated that should #621

@nealculiner

Description

@nealculiner

From the Q&A area...but I'm getting a lot of stored procedures whether like the one below that is a fire and forget or ones that return single values (scalars) that the generator is commenting out as it thinks it has output params, multiple result sets, etc. Consider pragma warnings if it's a feature EF core doesn't support at the time the generator code was written, etc. Leave it to the developer to test and decide? It just seems like the generator is not able to properly evaluate the sprocs as to whether EF Core can handle this async or not.

Another sproc I can't get an async method for:

ALTER PROCEDURE [dbo].[DeleteOldestBinary]
    @UserId INT, @ItemType INT
AS
BEGIN
    SET NOCOUNT ON;
    DECLARE @OldestBinaryId INT;

    SELECT @OldestBinaryId =
    (
        SELECT TOP (1) BinaryId
        FROM dbo.Binaries
        WHERE UserId = @UserId AND ItemType = @ItemType
        ORDER BY CreatedUtc
    );

    EXEC dbo.DeleteItemById @BinaryId = @OldestBinaryId; -- int
END;

// DeleteOldestBinaryAsync() cannot be created due to having out parameters, or is relying on the procedure result (int)

Not sure why this can't be executed async as it's essentially a fire and forget sproc

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions