is there a way, how to save EF (STE) entities in to temporary tables?
I’m trying to achieve this:
1) save my STE to temporary tables
2) run some stored procedures on them
3) depending on result from procedures, do something else..
Thank you.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
EF will not handle this. EF saves the entity to table(s) defined in mapping but the mapping is defined at design time. You cannot decide to save the entity to other table at runtime through EF without changing its mapping and that would be highly inefficient – changing mapping at runtime is not a supported use case so it is quite complicated and moreover applying a new mapping is the most expensive operation in EF.
You need just another stored procedure to insert your data to temporary table. Depending on the logic you expect you can either map that procedure to insert operation for the entity (but in such case your procedure will be used every time you insert a new entity) or simply execute it directly.