I have this method that I use with EF
RetryGetWithExpression<city, List<city>>(u => u.Take(10).ToList());
public static TValue RetryGetWithExpression<T, TValue>(
Func<ObjectSet<T>, TValue> func)
where T : class
{
var entitySet = entitiesContext.CreateObjectSet<T>();
return func(entitySet);
}
The above code works with the table entities generated by EF. What I am trying to do is to change the code in such way that it works with stored procedures.
This is the code that executes the SP:
Entities G = new Entities();
ObjectResult<retrieveMedia_Result> F = G.retrieveMedia(1);
When I try to convert RetryGetWithExpression to accept SPs, I get a problem that retrieveMedia is instance method and I cant pass it as u.retrieveMedia(1)
RetryGetWithExpression<Entities, ObjectResult<retrieveMedia_Result>>(
u => u.retrieveMedia(1));
public static TValue RetryGetWithExpression<T, TValue>(
Func<ObjectSet<T>, TValue> func)
where T : class
{
}
How to change the above code so that It works with SPs?
Try