Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
How to pass n number of parameters to Stored Procedure(SP) in Entity Framework 



What I have tried:

I have not any idea because in EF dynamically mapping is performed.So how can pass n- number of parameters in SP
Posted
Updated 4-Mar-16 9:08am
Comments
Maciej Los 3-Mar-16 4:26am    
Can you be so kind and provide more details about your issue...
What have you tried? Where are you stuck?
[no name] 3-Mar-16 4:35am    
Can you provide an example what do you exactly want..
Jörgen Andersson 3-Mar-16 4:44am    
Pass a collection
Sinisa Hajnal 3-Mar-16 6:33am    
You could pass XML parameter (single) with all the data you need. You could pass table type parameter in SQL Server. You could pass comma separated values (Again in single parameter). I don't think any stored procedure supports open ended number of parameters.

If you simply mean n (as in fixed always the same n) then you just write parameters into the SP with corresponding types and pass them through EF methods. You may need to override couple of methods.

1 solution

Pass raw SQL to EF


[Entity Framework Raw SQL Queries[^]]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900