Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NativeAOT的Repository模式下更新失败 #1771

Open
startewho opened this issue Apr 4, 2024 · 0 comments
Open

NativeAOT的Repository模式下更新失败 #1771

startewho opened this issue Apr 4, 2024 · 0 comments

Comments

@startewho
Copy link

startewho commented Apr 4, 2024

使用的https://github.com/2881099/aot_test 这里的例子
添加了FreeSql.Repository包.测试代码如下

  Console.WriteLine($"Rep模式");

	var rep = fsql.GetGuidRepository<TaskInfo>();

	fsql.Insert(data).ExecuteAffrows();

	var dbdata = fsql.Select<TaskInfo>().Where(a => a.Round == 0).First();
	dbdata.CurrentRound = -1;
	rep.Update(dbdata);

  Console.WriteLine($"更新完成");

数据库版本

sqlite,mysql

安装的Nuget包

3.2.820

.net framework/. net core? 及具体版本

.net8.0

出错结果:

Unhandled Exception: System.InvalidOperationException: The binary operator Equal is not defined for the types 'System.Reflection.Runtime.TypeInfos.RuntimeArrayTypeInfo' and 'System.Reflection.Runtime.TypeInfos.NativeFormat.NativeFormatRuntimeNamedTypeInfo'.
   at System.Linq.Expressions.Expression.GetEqualityComparisonOperator(ExpressionType, String, Expression, Expression, Boolean) + 0x26b
   at System.Linq.Expressions.Expression.Equal(Expression, Expression, Boolean, MethodInfo) + 0x63
   at FreeSql.Internal.Utils.<GetDataReaderValueBlockExpression>g__LocalFuncGetExpression|67_0(Boolean, Utils.<>c__DisplayClass67_0&) + 0x36f2
   at FreeSql.Internal.Utils.<GetDataReaderValueBlockExpression>g__LocalFuncGetExpression|67_0(Boolean, Utils.<>c__DisplayClass67_0&) + 0x6db
   at FreeSql.Internal.Utils.GetDataReaderValueBlockExpression(Type, Expression) + 0x18d
   at FreeSql.DbContext.<>c__DisplayClass67_0.<FlushCommand>b__5(String methodName) + 0x1ac
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey, Func`2) + 0xa4
   at FreeSql.DbContext.<>c__DisplayClass67_0.<FlushCommand>g__dbsetBatch|0(String) + 0xab
   at FreeSql.DbContext.<>c__DisplayClass67_0.<FlushCommand>g__funcUpdate|3(Boolean) + 0x20
   at FreeSql.DbContext.FlushCommand() + 0x2ce
   at FreeSql.RepositoryDbContext.SaveChanges() + 0x10
   at FreeSql.BaseRepository`1.Update(TEntity) + 0x33
   at Program.<Main>$(String[] args) + 0x16ce
   at orm_freesql!<BaseAddress>+0x833c03

最小复现项目

orm_freesql.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant