我有这个选择所有城市:
ExecuteStoreCommand<MCT_DBEntities>("select * from cities", ConnectionResolver.DB_Connection);
现在我正在尝试将 转换为 Lambda,但我该如何告诉它SELECT *
呢?
GetWithExpression<city, MCT_DBEntities>(u => u.SelectMany, ConnectionResolver.DB_Connection);
编辑:
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 }))
{...}