title: Entity framework - SP Returned value
body: <p>Working on my first mvc(5) asp.net web application. I am using data entity framework. I have a stored procedure, 'usp_EventInsert' which takes HevEventID, HemEmployeID and HevEventDescription:</p>
  
  <pre><code>@HevEventID int,
  @HemEmployeID int,
  @HevEventDescription varchar(150)
  
  SET NOCOUNT ON
  SET XACT_ABORT ON
  
  INSERT INTO [dbo].[RhEvent] ([HevEventID],[HemEmployeID],[HevEventDescription])
  SELECT @HevEventID, @HemEmployeID, @HevEventDescriptionID
  </code></pre>
  
  <p>In my code, I want to insert an event in the table and check if it was successful. I am calling it this way, for example:</p>
  
  <pre><code>myDBcontext.usp_EventInsert(123,112345,"some description")
  </code></pre>
  
  <p>I was expecting to be able to fetch the HevEventID(or HemEmployeID or HevEventDescriptionID) once the stored procedure is called. For example, I tried:</p>
  
  <pre><code>var event = myDBcontext.usp_EventInsert(123,112345,"some description")
  </code></pre>
  
  <p>I was expecting to find the elements in the select inside 'event'. But event = -1 when I try that.  Not only event doesn't have any of the select data in it, it's value is -1(From what I read SET NOCOUNT ON causes that?), which seems odd to me since the stored procedure was successful (new row being inserted in the table).</p>
  
  <p>any suggestions on how I can be sure the stored procedure was successful? Without doing a select on the table..</p>