Furion 1.15.9
webapi
问题描述:
书写entity的时候, 对entity增加了table属性. 但是在执行sql的时候,发现并没有按照table指定的名称进行查询.
如
[Table("b_user"), Comment("用户表")]
public class B_User : IEntity
{
....
}
执行sql的时候, 应该是执行
select * from b_user.
但跟踪日志,发现 执行的sql是 select * from B_User
以下是日志
【时间】2021-03-14 10:12:52.157
【等级】ERR
【消息】An exception occurred while iterating over the results of a query for context type '"RemisApi.EntityFramework.Core.DbContexts.REMISDbContext"'."
""Npgsql.PostgresException (0x80004005): 42P01: relation "B_User" does not exist
at Npgsql.NpgsqlConnector.g__ReadMessageLong|194_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage)
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken)
at Npgsql.NpgsqlCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func
4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable
1.AsyncEnumerator.MoveNextAsync()
Exception data:
Severity: ERROR
SqlState: 42P01
MessageText: relation "B_User" does not exist
Position: 176
File: d:\pginstaller_13.auto\postgres.windows-x64\src\backend\parser\parse_relation.c
Line: 1379
Routine: parserOpenTable"
特别说明:如果 Issue 报告为问题且开发成员回复确认问题之后但三天内都不能得到反馈,则视为无效Issue。
Furion 版本号
哪个版本号?
Web 项目类型
描述你的问题
发生了什么?
异常堆栈信息
异常堆栈是什么?
代码或代码仓库
什么代码导致?
数据库信息
期待结果
期待的结果是?