33using System . Data ;
44using System . Threading . Tasks ;
55using ServiceStack . Data ;
6- using ServiceStack . Templates ;
6+ using ServiceStack . Script ;
77
88namespace ServiceStack . OrmLite
99{
10- public class TemplateDbFiltersAsync : TemplateFilter
10+ [ Obsolete ( "Use DbScriptsAsync" ) ]
11+ public class TemplateDbFiltersAsync : DbScriptsAsync { }
12+
13+ public class DbScriptsAsync : ScriptMethods
1114 {
1215 private IDbConnectionFactory dbFactory ;
1316 public IDbConnectionFactory DbFactory
@@ -16,7 +19,7 @@ public IDbConnectionFactory DbFactory
1619 set => dbFactory = value ;
1720 }
1821
19- public async Task < IDbConnection > OpenDbConnectionAsync ( TemplateScopeContext scope , Dictionary < string , object > options )
22+ public async Task < IDbConnection > OpenDbConnectionAsync ( ScriptScopeContext scope , Dictionary < string , object > options )
2023 {
2124 if ( options != null )
2225 {
@@ -35,7 +38,7 @@ public async Task<IDbConnection> OpenDbConnectionAsync(TemplateScopeContext scop
3538 return await DbFactory . OpenAsync ( ) ;
3639 }
3740
38- async Task < object > exec < T > ( Func < IDbConnection , Task < T > > fn , TemplateScopeContext scope , object options )
41+ async Task < object > exec < T > ( Func < IDbConnection , Task < T > > fn , ScriptScopeContext scope , object options )
3942 {
4043 try
4144 {
@@ -51,43 +54,43 @@ async Task<object> exec<T>(Func<IDbConnection, Task<T>> fn, TemplateScopeContext
5154 }
5255 }
5356
54- public Task < object > dbSelect ( TemplateScopeContext scope , string sql ) =>
57+ public Task < object > dbSelect ( ScriptScopeContext scope , string sql ) =>
5558 exec ( db => db . SqlListAsync < Dictionary < string , object > > ( sql ) , scope , null ) ;
5659
57- public Task < object > dbSelect ( TemplateScopeContext scope , string sql , Dictionary < string , object > args ) =>
60+ public Task < object > dbSelect ( ScriptScopeContext scope , string sql , Dictionary < string , object > args ) =>
5861 exec ( db => db . SqlListAsync < Dictionary < string , object > > ( sql , args ) , scope , null ) ;
5962
60- public Task < object > dbSelect ( TemplateScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
63+ public Task < object > dbSelect ( ScriptScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
6164 exec ( db => db . SqlListAsync < Dictionary < string , object > > ( sql , args ) , scope , options ) ;
6265
6366
64- public Task < object > dbSingle ( TemplateScopeContext scope , string sql ) =>
67+ public Task < object > dbSingle ( ScriptScopeContext scope , string sql ) =>
6568 exec ( db => db . SingleAsync < Dictionary < string , object > > ( sql ) , scope , null ) ;
6669
67- public Task < object > dbSingle ( TemplateScopeContext scope , string sql , Dictionary < string , object > args ) =>
70+ public Task < object > dbSingle ( ScriptScopeContext scope , string sql , Dictionary < string , object > args ) =>
6871 exec ( db => db . SingleAsync < Dictionary < string , object > > ( sql , args ) , scope , null ) ;
6972
70- public Task < object > dbSingle ( TemplateScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
73+ public Task < object > dbSingle ( ScriptScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
7174 exec ( db => db . SingleAsync < Dictionary < string , object > > ( sql , args ) , scope , options ) ;
7275
7376
74- public Task < object > dbScalar ( TemplateScopeContext scope , string sql ) =>
77+ public Task < object > dbScalar ( ScriptScopeContext scope , string sql ) =>
7578 exec ( db => db . ScalarAsync < object > ( sql ) , scope , null ) ;
7679
77- public Task < object > dbScalar ( TemplateScopeContext scope , string sql , Dictionary < string , object > args ) =>
80+ public Task < object > dbScalar ( ScriptScopeContext scope , string sql , Dictionary < string , object > args ) =>
7881 exec ( db => db . ScalarAsync < object > ( sql , args ) , scope , null ) ;
7982
80- public Task < object > dbScalar ( TemplateScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
83+ public Task < object > dbScalar ( ScriptScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
8184 exec ( db => db . ScalarAsync < object > ( sql , args ) , scope , options ) ;
8285
8386
84- public Task < object > dbExec ( TemplateScopeContext scope , string sql ) =>
87+ public Task < object > dbExec ( ScriptScopeContext scope , string sql ) =>
8588 exec ( db => db . ExecuteSqlAsync ( sql ) , scope , null ) ;
8689
87- public Task < object > dbExec ( TemplateScopeContext scope , string sql , Dictionary < string , object > args ) =>
90+ public Task < object > dbExec ( ScriptScopeContext scope , string sql , Dictionary < string , object > args ) =>
8891 exec ( db => db . ExecuteSqlAsync ( sql , args ) , scope , null ) ;
8992
90- public Task < object > dbExec ( TemplateScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
93+ public Task < object > dbExec ( ScriptScopeContext scope , string sql , Dictionary < string , object > args , object options ) =>
9194 exec ( db => db . ExecuteSqlAsync ( sql , args ) , scope , options ) ;
9295
9396
0 commit comments