NET8 ORM uses AOT SqlSugar and EF Core
NET8 ORM uses AOT SqlSugar and EF Core Introduction to .NET AOT .Net8’s native precoded machine code NET AOT, which is almost 100% bootstrapped. Microsoft has made a lot of efforts to get rid of the constraints of C++. That is to say, the code is almost rewritten in C#, including virtual machine, GC, memory model, etc. What C++ needs to do is just the boot program. This article looks at the operating mode of this crucial boot program through the code. .NET support functions SqlSugar ORM uses AOT to operate the database SqlSugar has perfectly supported .net aot. The following DEMO includes table creation, insertion, query, deletion and update After decompression, you can publish it directly into an AOT file aot_test-master.rar Nuget installation SqlSugarCore Add, delete, check and modify code StaticConfig.EnableAot = true;//Enable AOT. Just start the program and execute it once. //Use SqlSugarClient to create new every time, do not use singleton mode var db = new SqlSugarClient(new ConnectionConfig() { IsAutoCloseConnection = true, DbType = DbType.Sqlite, ConnectionString = “datasource=demo.db” }, it => { // Logging SQL statements and parameters before execution //Record SQL statements and parameters before execution it.Aop.OnLogExecuting = (sql, para) => { Console.WriteLine(UtilMethods.GetNativeSql(sql, para)); };…
NET8 ORM uses AOT SqlSugar and EF Core
NET8 ORM uses AOT SqlSugar and EF Core Introduction to .NET AOT .Net8’s native precoded machine code NET AOT, which is almost 100% bootstrapped. Microsoft has made a lot of efforts to get rid of the constraints of C++. That is to say, the code is almost rewritten in C#, including virtual machine, GC, memory model, etc. What C++ needs to do is just the boot program. This article looks at the operating mode of this crucial boot program through the code. .NET support functions SqlSugar ORM uses AOT to operate the database SqlSugar has perfectly supported .net aot. The following DEMO includes table creation, insertion, query, deletion and update After decompression, you can publish it directly into an AOT file aot_test-master.rar Nuget installation SqlSugarCore Add, delete, check and modify code StaticConfig.EnableAot = true;//Enable AOT. Just start the program and execute it once. //Use SqlSugarClient to create new every time, do not use singleton mode var db = new SqlSugarClient(new ConnectionConfig() { IsAutoCloseConnection = true, DbType = DbType.Sqlite, ConnectionString = “datasource=demo.db” }, it => { // Logging SQL statements and parameters before execution //Record SQL statements and parameters before execution it.Aop.OnLogExecuting = (sql, para) => { Console.WriteLine(UtilMethods.GetNativeSql(sql, para)); };…