How to add stored procedure (NOP 1.9)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi

I have successfully added a new stored procedure to the database, and I also updated my .edmx-model. Whilst updating I found my new stored procedure.

However, when updating the database also updates NopObjectContext.Functions and NopObjectContext.ObjectSets, but the new stored procedure is not included.

What have I missed?
12 years ago
Anyone?
12 years ago
You have to manually add them to the corresponding library, the EDMX only maps it, but in order to use it you need to add it to one of the services.
11 years ago
1- Go to your designer NopModel.edmx and click right :"Update Model form database..."

2-Then, Click right on designer -> Add > Function Import

-> Function ImportName : Sp_yourprocedureName (because All the procedures of Nop are prefixed with Sp_ , so you can keep this naming logic)

-> Stored Procedure Name : Select your new stored procedure name

Select your return type of your procedure name.
(NB: If you create a store procedure who return several field of several different tables , create une class whose inhereit BusinessEntity , with all the properties that return your procedure stored).

Click on Ok -> Recompile Nop.BusinessLogic and go to the end of the file NopObjectContext.Function.cs

-> your function was added with good signature and you can call it since your business logic library.

CQFD
11 years ago
i am using nop 2.8 (with source code)
can u tell me where the edmx file is located
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.