I am trying to call a stored procedure using entity framework 6. I get an error on the output message.
A first chance exception of type 'System.Data.Entity.Core.EntityCommandExecutionException' occurred in EntityFramework.SqlServer.dll
using (var context = new PartnerPortalEntities2())
{
var outputParameter = new ObjectParameter("result", typeof(string));
var spresults = context.assignRoles_CreateAccountAndContacts(user.Id, role, user.AccountId, user.AccountName, user.ContactId, user.FirstName, user.LastName, outputParameter);
// Control never comes after the above line
if(spresults.Equals("1"))
{
//Do something
}
else
{
// Do something
}
}
When i do a debug, The control goes to line where the stored procedure is called after which we get the above error on the output window and the debugger stops, it never gets into the if statements.
I have run the stored procedure on SQLserver and it works fine there. Any thoughts what could be the error. I have built the context by generating the code from database.