title: How to pass multiple parameters to stored procedure on .net core 3.1
body: <p>I wrote a function years ago, and works perfectly until migrate to .NET Core 3.1. Now parameters has not pass to SQL Server. My function is:</p>
  <pre><code>public async Task&lt;IList&lt;string&gt;&gt; GetTree(GetPayload payload)
  {
      var cx = this.uow.Repository&lt;Organization&gt;().Context;
  
      var parameters = new List&lt;SqlParameter&gt;();
  
      if (string.IsNullOrEmpty(payload.Code) == false)
          parameters.Add(new SqlParameter(&quot;@code&quot;, payload.Code));
  
      if (payload.ParentId.IsNullOrEmpty() == false)
          parameters.Add(new SqlParameter(&quot;@parentId&quot;, payload.ParentId));
      
      var orgRes = await cx.Organization.FromSqlRaw(&quot;SP_GetOrganization&quot;, parameters.ToArray()).ToListAsync();
    
      return orgRes
  }
  </code></pre>
  <p>When debug this code, parameters succesfully come to API. But when SQL call with 'FromSqlRaw', parameters as shown '0'. Why?</p>
  <p>Here is my stored procedure:</p>
  <pre><code>DECLARE @RC int
  DECLARE @code nvarchar(50)
  DECLARE @parentId uniqueidentifier
  DECLARE @perId uniqueidentifier
  DECLARE @isDeleted bit
  
  -- TODO: Set parameter values here.
  
  EXECUTE @RC = [dbo].[SP_GetOrgTree] 
     @code
    ,@parentId
    ,@perId
    ,@isDeleted
  GO
  </code></pre>
  <p>In SQL, when edit code like this: procedure is run with no problem. How can I fix this in EF Core?</p>
  <pre><code>DECLARE @RC int
      DECLARE @code nvarchar(50)
      DECLARE @parentId uniqueidentifier
      DECLARE @perId uniqueidentifier
      DECLARE @isDeleted bit
      
      SET @code = 'sample code'
      
      EXECUTE @RC = [dbo].[SP_GetOrgTree] 
         @code
        ,@parentId
        ,@perId
        ,@isDeleted
      GO
  </code></pre>