private IDataLayer GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
        {
            string     connstr = "XpoProvider=MSSqlServer;" + ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString;
            IDataLayer dl      = XpoDefault.GetDataLayer(connstr, autoCreateOption);

            dl.Dictionary.GetDataStoreSchema(typeof(XPOEntity));
            return(dl);
        }
        private IDataLayer GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
        {
            string     connstr = TestSetConfig.XPOConnectionStrings;
            IDataLayer dl      = XpoDefault.GetDataLayer(connstr, autoCreateOption);

            dl.Dictionary.GetDataStoreSchema(typeof(Contact));
            return(dl);
        }
Exemple #3
0
 public static void Connect(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption, bool threadSafe = false)
 {
     if (threadSafe)
     {
         var provider   = XpoDefault.GetConnectionProvider(ConnectionString, autoCreateOption);
         var dictionary = new DevExpress.Xpo.Metadata.ReflectionDictionary();
         dictionary.GetDataStoreSchema(persistentTypes);
         XpoDefault.DataLayer = new ThreadSafeDataLayer(dictionary, provider);
     }
     else
     {
         XpoDefault.DataLayer = XpoDefault.GetDataLayer(ConnectionString, autoCreateOption);
     }
     XpoDefault.Session = null;
 }
Exemple #4
0
 public static IDataLayer GetDataLayer(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
 {
     return(XpoDefault.GetDataLayer(ConnectionString, autoCreateOption));
 }
Exemple #5
0
 public static DevExpress.Xpo.DB.IDataStore GetConnectionProvider(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption, out IDisposable[] objectsToDisposeOnDisconnect)
 {
     return(XpoDefault.GetConnectionProvider(ConnectionString, autoCreateOption, out objectsToDisposeOnDisconnect));
 }
Exemple #6
0
 public static DevExpress.Xpo.DB.IDataStore GetConnectionProvider(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
 {
     return(XpoDefault.GetConnectionProvider(ConnectionString, autoCreateOption));
 }
Exemple #7
0
 public static void Connect(DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
 {
     XpoDefault.DataLayer = XpoDefault.GetDataLayer(ConnectionString, autoCreateOption);
     XpoDefault.Session   = null;
 }
 public static IDataLayer GetDataLayer(IConfiguration configuration, DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
 {
     return(XpoDefault.GetDataLayer(configuration.GetConnectionString(ConnectionStringName), autoCreateOption));
 }
 public static DevExpress.Xpo.DB.IDataStore GetConnectionProvider(IConfiguration configuration, DevExpress.Xpo.DB.AutoCreateOption autoCreateOption)
 {
     return(XpoDefault.GetConnectionProvider(configuration.GetConnectionString(ConnectionStringName), autoCreateOption));
 }