/// </summary>\r
/// <param name="connectionString">specifies file or server connection</param>\r
[DbLinqToDo]\r
- public DataContext(string connectionString)\r
+ public DataContext(string fileOrServerOrConnection)\r
{\r
Profiler.At("START DataContext(string)");\r
- IVendor ivendor = GetVendor(ref connectionString);\r
+ IVendor ivendor = GetVendor(ref fileOrServerOrConnection);\r
\r
- IDbConnection dbConnection = ivendor.CreateDbConnection(connectionString);\r
+ IDbConnection dbConnection = ivendor.CreateDbConnection(fileOrServerOrConnection);\r
Init(new DatabaseContext(dbConnection), null, ivendor);\r
\r
Profiler.At("END DataContext(string)");\r
_VendorProvider = ObjectFactory.Get<IVendorProvider>();\r
Vendor = vendor ?? \r
(connectionString != null ? GetVendor(ref connectionString) : null) ??\r
+#if MOBILE\r
+ _VendorProvider.FindVendorByProviderType(typeof(DbLinq.Sqlite.SqliteSqlProvider));\r
+#else\r
_VendorProvider.FindVendorByProviderType(typeof(SqlClient.Sql2005Provider));\r
+#endif\r
\r
DatabaseContext = databaseContext;\r
\r
}\r
}\r
\r
- private static MethodInfo _WhereMethod = typeof(Queryable).GetMethods().First(m => m.Name == "Where");\r
+ private static MethodInfo _WhereMethod;\r
internal object GetOtherTableQuery(Expression predicate, ParameterExpression parameter, Type otherTableType, IQueryable otherTable)\r
{\r
+ if (_WhereMethod == null)\r
+ System.Threading.Interlocked.CompareExchange (ref _WhereMethod, typeof(Queryable).GetMethods().First(m => m.Name == "Where"), null);\r
+\r
//predicate: other.EmployeeID== "WARTH"\r
Expression lambdaPredicate = Expression.Lambda(predicate, parameter);\r
//lambdaPredicate: other=>other.EmployeeID== "WARTH"\r