static void Main(string[] args) { ConfigManager.DbFactoryName = "System.Data.SQLite"; ConfigManager.DataBase = "SQLite"; //TestDataContext db = new TestDataContext(); //db.Set<User>(); //var provider = ProviderFactory.CreateProvider(ConfigManager.DataBaseType); //var op = provider.CreateEntityOperator(); //var list = new ArrayList(); var scope = new TransactionScope(); //list.Add(new User() { }); //op.InsertEntities(list); var _sqlExecutor = new SqlExecutor(); var obj = _sqlExecutor.ExecuteScalar(string.Format("select max(Count) from Seqs where Name='User'"), new Dictionary<string, object>()); obj = _sqlExecutor.ExecuteNonQuery(string.Format("insert into Seqs(Name,Count) values('User',1)"), new Dictionary<string, object>()); scope.Complete(); scope.Dispose(); Console.ReadKey(); }
static void Main(string[] args) { ConfigManager.DbFactoryName = "System.Data.SQLite"; ConfigManager.DataBase = "SQLite"; //TestDataContext db = new TestDataContext(); //db.Set<User>(); //var provider = ProviderFactory.CreateProvider(ConfigManager.DataBaseType); //var op = provider.CreateEntityOperator(); //var list = new ArrayList(); var scope = new TransactionScope(); //list.Add(new User() { }); //op.InsertEntities(list); var _sqlExecutor = new SqlExecutor(); var obj = _sqlExecutor.ExecuteScalar(string.Format("select max(Count) from Seqs where Name='User'"), new Dictionary <string, object>()); obj = _sqlExecutor.ExecuteNonQuery(string.Format("insert into Seqs(Name,Count) values('User',1)"), new Dictionary <string, object>()); scope.Complete(); scope.Dispose(); Console.ReadKey(); }