Example #1
0
        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));
        }
Example #2
0
 protected internal object InstantiateBaseContext(IConnectionInfo cxInfo)
 {
     return(Activator.CreateInstance(DataContextDriver.LoadAssemblySafely(cxInfo.CustomTypeInfo.CustomAssemblyPath).GetType(cxInfo.CustomTypeInfo.CustomTypeName, true), this.GetContextConstructorArguments(cxInfo)));
 }