I have this that selects all cities:
ExecuteStoreCommand<MCT_DBEntities>("select * from cities", ConnectionResolver.DB_Connection);
Now I am trying to convert the to Lambda, but how do I tell it to SELECT *?
GetWithExpression<city, MCT_DBEntities>(u => u.SelectMany, ConnectionResolver.DB_Connection);
Edit:
private static TValue RetryGetWithExpression<U,T, TValue>(Func<ObjectSet<T>, TValue> func, String connection, Int32 retryInfiniteLoopGuard = 0)
where T : class
where U : ObjectContext
{
Microsoft.Practices.TransientFaultHandling.RetryPolicy policy = RetryPolicyProvider.GetSqlAzureRetryPolicy();
using (U entitiesContext = (U)Activator.CreateInstance(typeof(U), new[] { connection }))
{...}
If your first parameter is
Expression<Func<T, bool>>you may want:Edit.
This should work: