Need LINQ that does stored procedure

Charles Baldo
Charles Baldo used Ask the Experts™
on
Hello

I have this as  a  stored procedure

CREATE PROCEDURE [dbo].[spCreateInvoiceReceipt]
AS
BEGIN
      SET NOCOUNT ON;
      declare @id bigint
      INSERT INTO  InvoiceReceipt (CreateDate)
      VALUES (getdate())
      SET @id=SCOPE_IDENTITY()
     update InvoiceReceipt set ReceiptNumber=@id where id=@id
END


How can I do this with Entity Frameworks LINQ?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
SQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018
Commented:
If you meant how to call this from LINQ, then below can help..
Of course, in the below example there was an input parameter in procedure and hence they have provided values in the code which you can skip out..
https://www.c-sharpcorner.com/UploadFile/dhananjaycoder/using-stored-procedure-in-linq/
Charles BaldoSoftware Developer

Author

Commented:
Thank you worked well
Raja Jegan RSQL Server DBA & Architect, EE Solution Guide
Awarded 2009
Distinguished Expert 2018

Commented:
Welcome, glad to assist..

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial