private static Assembly GetEfAssembly(IConnectionInfo cxInfo) { if (_efAssembly != null) { return(_efAssembly); } _efAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault <Assembly>(a => a.FullName.StartsWith("entityframework,", StringComparison.InvariantCultureIgnoreCase)); if (_efAssembly != null) { return(_efAssembly); } string efPath = GetEfPath(cxInfo, false); if (efPath == null) { return(null); } if (efPath.Contains <char>(',')) { return(_efAssembly = Assembly.Load(efPath)); } return(_efAssembly = DataContextDriver.LoadAssemblySafely(efPath)); }
protected internal object InstantiateBaseContext(IConnectionInfo cxInfo) { return(Activator.CreateInstance(DataContextDriver.LoadAssemblySafely(cxInfo.CustomTypeInfo.CustomAssemblyPath).GetType(cxInfo.CustomTypeInfo.CustomTypeName, true), this.GetContextConstructorArguments(cxInfo))); }