Exemple #1
0
        static OrmLiteConnectionFactory factory = new OrmLiteConnectionFactory("Server=15.164.165.164;Database=tutorialtest;User Id=root;Password=0000;", MySqlDialect.Provider); // ConnectionString
        public static System.Data.IDbConnection Open()
        {
            var con = factory.CreateDbConnection();

            con.Open();
            return(con);
        }
		public void Can_insert_and_select_from_ModelWithFieldsOfDifferentAndNullableTypes_table_compact_GUID()
        {
            Firebird.FirebirdOrmLiteDialectProvider dialect = new Firebird.FirebirdOrmLiteDialectProvider(true);
            OrmLiteConnectionFactory factory = new OrmLiteConnectionFactory(ConnectionString, dialect);
            using (var db = factory.CreateDbConnection())
            {
                db.Open();
                Can_insert_and_select_from_ModelWithFieldsOfDifferentAndNullableTypes_table_impl(db);
            }
        }
        public void Can_insert_and_select_from_ModelWithFieldsOfDifferentAndNullableTypes_table_compact_GUID()
        {
            Firebird.FirebirdOrmLiteDialectProvider dialect = new Firebird.FirebirdOrmLiteDialectProvider(true);
            OrmLiteConnectionFactory factory = new OrmLiteConnectionFactory(ConnectionString, dialect);

            using (var db = factory.CreateDbConnection())
            {
                db.Open();
                Can_insert_and_select_from_ModelWithFieldsOfDifferentAndNullableTypes_table_impl(db);
            }
        }
Exemple #4
0
        public void SaveSensorData(EventDataEntity entity)
        {
            using (IDbConnection db = ormLiteConnectionFactory.CreateDbConnection()) {
                db.Open();


                try {
                    db.Save(entity);
                    long   meh   = db.LastInsertId();
                    string uhhuh = db.GetLastSql();
                } catch (Exception ex) {
                    string uhhuh = db.GetLastSql();

                    var text = ex.Message;
                }
            }
        }
 public ContactRepository(OrmLiteConnectionFactory dbFactory)
 {
     DbFactory   = dbFactory;
     _connection = dbFactory.CreateDbConnection();
 }
Exemple #6
0
 public ImageUploadRepository(OrmLiteConnectionFactory dbFactory)
 {
     DbFactory   = dbFactory;
     _connection = DbFactory.CreateDbConnection();
 }
Exemple #7
0
 public ProfileRepository(OrmLiteConnectionFactory dbFactory)
 {
     DbFactory   = dbFactory;
     _connection = DbFactory.CreateDbConnection();
 }