locked
How EF can capture return message or data from store procedure RRS feed

  • Question

  • User1183902823 posted

    here is a example of store procedures which return data so many different way

    just return value
    --------------------
    CREATE PROCEDURE GetMyInt
    ( @Param int)
    AS
    DECLARE @ReturnValue int
    
    SELECT @ReturnValue=MyIntField FROM MyTable WHERE MyPrimaryKeyField = @Param
    RETURN @ReturnValue
    GO
    
    
    value return by output parameter
    ------------------------------------
    CREATE PROCEDURE GetMyInt
    ( @Param     int
     ,@OutValue  int OUTPUT)
    AS
    SELECT @OutValue=MyIntField FROM MyTable WHERE MyPrimaryKeyField = @Param
    RETURN 0
    GO
    
    return value as resultset
    -------------------------
    CREATE PROCEDURE GetMyInt
    ( @Param     int)
    AS
    SELECT MyIntField FROM MyTable WHERE MyPrimaryKeyField = @Param
    RETURN 0
    GO

    there is 3 different approach. now if we call these 3 store procedure by EF then how EF can capture return data.

    Tuesday, December 5, 2017 10:01 AM

Answers

All replies