title: Getting stored procedure output parameter with LINQ and Entity Framework
body: <p>I've created a stored procedure that takes parameters to create a user. If the user already exists it sets the output parameter to 'User already exists' and does nothing more. </p>
  
  <p>Now I've mapped this function (InsertNewUser) to my Entity Framework and am calling it like so: </p>
  
  <pre>
  context.InsertNewUser(email, name, passwordhash, salt, ???)
  </pre>
  
  <p>The ??? is where I'm having trouble. In the stored procedure this parameter is an OUTPUT parameter. I tried declaring a string and then passing in "out declaredString" but that wasn't correct. </p>
  
  <p>I'm not sure I'm going about this the right way, any thoughts?</p>
  
  <p>This is the Stored Procedure:</p>
  
  <pre>
  ALTER PROCEDURE dbo.InsertNewUser
  
      (
      @eMail nvarchar(256),
      @firstName nvarchar(256),
      @lastName nvarchar(256),
      @passwordHash nvarchar(256),
      @salt nvarchar(256),
      @output nvarchar(256) OUTPUT
      )
  
  AS
      /* Saves a user to the db. */
      BEGIN
      --First check if the user doesn't exist
      IF EXISTS (SELECT eMail FROM UserSet WHERE eMail = @eMail)  
          --Return that user exists
          SET @output = 'User exists' 
      ELSE    
          INSERT INTO UserSet
          VALUES (@eMail, @firstName, @lastName, @passwordHash, @salt)
      END
  </pre>