zzzprojects / Dapper-Plus

Dapper Plus - High-Efficient Bulk Actions (Insert, Update, Delete, and Merge) for .NET
https://dapper-plus.net/
380 stars 84 forks source link

Does this support Aot #143

Closed xyyhqq closed 3 months ago

xyyhqq commented 4 months ago

Does this support Aot publish ? Dapper.AOT it supports Aot

I Test It at Aot Mode on .net8

code:

string targetFile=  AppDomain.CurrentDomain.BaseDirectory + "\\TemplateDataDb.db" 
 private bool BatchAddData(string targetFile, List<TestData > value)
 {
     bool inserOk = false;
     try
     {

         if (File.Exists(targetFile))
         {
             using (SqliteConnection sqliteConnection = new SqliteConnection("Data Source=" + targetFile))
             {
                 sqliteConnection.BulkMerge(value);
                 inserOk = true;
             }

         }

     }
     catch (Exception ex)
     { 
         LogHelper.LogInformation(ex.StackTrace+" "+ex.Message);
     }
     return inserOk;
 }

ILogs Infomation:

at Z.Dapper.Plus.DapperPlusAction.Execute() + 0x6e4 at Z.Dapper.Plus.DapperPlusAction..ctor(BaseDapperPlusActionSet, String, DapperPlusActionKind, Object) + 0x15f at Z.Dapper.Plus.DapperPlusActionSet1.AddAction(String, DapperPlusActionKind, TEntity) + 0x46 at Z.Dapper.Plus.DapperPlusActionSet1.DapperPlusActionSetBuilder(DapperPlusContext, IDbConnection, IDbTransaction, String, DapperPlusActionKind, TEntity, Func2[]) + 0x164 at AvaloniaApplicationAot.ClientManager.UnPackHandler.BatchAddData(String, List1) + 0xed Object reference not set to an instance of an object. |

JonathanMagnan commented 4 months ago

Hello @xyyhqq ,

Dapper Plus is currently not tested for AOT, and there is no short-term plan at this moment to support AOT.

It might eventually come but that's currently not one of our priority.

Best Regards,

Jon