UDF call in entity framework is cached

Posted by Fred Yang on Stack Overflow See other posts from Stack Overflow or by Fred Yang
Published on 2010-04-01T02:14:42Z Indexed on 2010/04/01 2:23 UTC
Read the original article Hit count: 536

Filed under:
|

I am doing a test after reading an article http://blogs.msdn.com/alexj/archive/2009/08/07/tip-30-how-to-use-a-custom-store-function.aspx about udf function called. When I use a function with objectContext.Entities.Where( t=> udf(para1, para2) == 1), here the Entities is not ObjectQuery, but an ObjectSet, the first time I call the method, it runs correctly, if I reuse the objectContext,and run it again but with different para1, para2, then the previous parameter values still cached, and the result is same as previous one, which is wrong. The sql profiler shows that both query hit the database, but the t-sql is the same. Am I missing something? And the ObjectSet does not support .where(esql_string). How to get udf working with ObjectSet?

Thanks Fred

© Stack Overflow or respective owner

Related posts about entity

Related posts about entity-framework