33using System . Linq ;
44using System . Text ;
55using System . Text . Json ;
6+ using System . Threading . Tasks ;
67using appMpower . Orm . Data ;
78using appMpower . Orm . Objects ;
89using appMpower . Orm . Serializers ;
@@ -35,9 +36,9 @@ public static void DbProvider(int dbProvider)
3536 DbFactory . SetInstance ( ) ;
3637 }
3738
38- public static byte [ ] Db ( )
39+ public static async Task < byte [ ] > Db ( )
3940 {
40- var world = RawDb . LoadSingleQueryRow ( ) ;
41+ var world = await RawDb . LoadSingleQueryRowAsync ( ) ;
4142
4243 var memoryStream = new MemoryStream ( ) ;
4344 using var utf8JsonWriter = new Utf8JsonWriter ( memoryStream , _jsonWriterOptions ) ;
@@ -47,9 +48,9 @@ public static byte[] Db()
4748 return memoryStream . ToArray ( ) ;
4849 }
4950
50- public static byte [ ] DbById ( int id )
51+ public static async Task < byte [ ] > DbById ( int id )
5152 {
52- var world = RawDb . LoadSingleQueryRowById ( id ) ;
53+ var world = await RawDb . LoadSingleQueryRowByIdAsync ( id ) ;
5354
5455 var memoryStream = new MemoryStream ( ) ;
5556 using var utf8JsonWriter = new Utf8JsonWriter ( memoryStream , _jsonWriterOptions ) ;
@@ -59,9 +60,9 @@ public static byte[] DbById(int id)
5960 return memoryStream . ToArray ( ) ;
6061 }
6162
62- public static byte [ ] Query ( int queries )
63+ public static async Task < byte [ ] > Query ( int queries )
6364 {
64- World [ ] worlds = RawDb . ReadMultipleRows ( queries ) ;
65+ World [ ] worlds = await RawDb . ReadMultipleRowsAsync ( queries ) ;
6566
6667 var memoryStream = new MemoryStream ( ) ;
6768 using var utf8JsonWriter = new Utf8JsonWriter ( memoryStream , _jsonWriterOptions ) ;
@@ -71,9 +72,9 @@ public static byte[] Query(int queries)
7172 return memoryStream . ToArray ( ) ;
7273 }
7374
74- public static byte [ ] Updates ( int count )
75+ public static async Task < byte [ ] > Updates ( int count )
7576 {
76- World [ ] worlds = RawDb . LoadMultipleUpdatesRows ( count ) ;
77+ World [ ] worlds = await RawDb . LoadMultipleUpdatesRowsAsync ( count ) ;
7778
7879 var memoryStream = new MemoryStream ( ) ;
7980 using var utf8JsonWriter = new Utf8JsonWriter ( memoryStream , _jsonWriterOptions ) ;
@@ -83,9 +84,9 @@ public static byte[] Updates(int count)
8384 return memoryStream . ToArray ( ) ;
8485 }
8586
86- public static byte [ ] Fortunes ( )
87+ public static async Task < byte [ ] > Fortunes ( )
8788 {
88- List < Fortune > fortunes = RawDb . LoadFortunesRows ( ) ;
89+ List < Fortune > fortunes = await RawDb . LoadFortunesRowsAsync ( ) ;
8990 string fortunesView = FortunesView . Render ( fortunes ) ;
9091 byte [ ] byteArray = Encoding . UTF8 . GetBytes ( fortunesView ) ;
9192
0 commit comments