I have a storedprocedure "SelectKP" (Datetime bt,Datetime et), please help to create a class and a repository for this procedure.
Asked
Active
Viewed 1,572 times
2 Answers
0
Look at this link: How to execute a stored procedure within C# program
There is not a function generated manually, but it executes stored procedure
-
1thanks for the answer, but I was a little mistake in the question, i need add function manual – He11b0rn May 28 '12 at 11:28
-
Sorry, I don't understand meaning of the word manual in this context – karaxuna May 28 '12 at 11:39
-
@He11b0rn, so you mean a user-defined function? – Gert Arnold May 28 '12 at 15:08
0
Here is simple example.
using (var db = new ModelEntities())
{
var query = db.ExecuteStoreQuery<ModelClass>("StoreProcedureName '" + UserId +"'");
}

Imran Rashid
- 3,352
- 4
- 31
- 41