I have a stored procedure that adds a new entry to a table and OUTPUTS the `TransactionId` (as int) to `@TransactionId`.
Here I want to retrieve the output parameter from a stored procedure in Entity Framework (EDMX)
(i found several questions like this but I could not grasp because I am new in web API)
I can exec the procedure just fine to the ASP.NET backend using Postman but I can't get the OUTPUT (parameter to return). I don't know how to capture the OUTPUT in the C# post method.
For clarification, I'm trying to exec a stored procedure and capture the output using entity framework. I don't know how to capture or call the output parameter in web API to display.
My API code is
[HttpPost]public void Stock([FromBody] Listjsonvalues) {foreach (spGetNewStockCountHeader_Result Datastock in jsonvalues){ObjectParameter TransactionId = new ObjectParameter("TransactionId", typeof(Int32));spGetNewStockCountHeader_Result Stockobject = new spGetNewStockCountHeader_Result();Stockobject.UserID = Datastock.UserID;Stockobject.created = Datastock.created;Stockobject.CompanyID = Datastock.CompanyID;Stockobject.modified = Datastock.modified;Stockobject.modifieduserid = Datastock.modifieduserid;Stockobject.confirm = Datastock.confirm;Stockobject.ShopId = Datastock.ShopId;enqentities.spGetNewStockCountHeader(Datastock.UserID, Datastock.created,Datastock.CompanyID, Datastock.modified, Datastock.modifieduserid, Datastock.confirm,Datastock.ShopId, TransactionId);}}
Mageshwaran RPosted Nov 21, 2019, 10:44 AM
Nithya NarashimanPosted Aug 22, 2019, 7:39 PM