Oracle.EntityFrameworkCore 3.19映射到视图
我正在尝试映射到Oracle的最新EF核心提供商的视图 这是我的看法Oracle.EntityFrameworkCore 3.19映射到视图,oracle,ef-core-3.1,Oracle,Ef Core 3.1,我正在尝试映射到Oracle的最新EF核心提供商的视图 这是我的看法 create view samson.CustomersContacts as select c.ID CustomerId, c.NAME CustomerName, ctype.NAME CustomerType, ct.NAME ContactName, ct.EMAIL ContactEmail, ct.PHONE ContactPhone from CU
create view samson.CustomersContacts as
select c.ID CustomerId,
c.NAME CustomerName,
ctype.NAME CustomerType,
ct.NAME ContactName,
ct.EMAIL ContactEmail,
ct.PHONE ContactPhone
from CUSTOMER c
left outer join CUSTOMER_TYPE ctype on c.CUSTOMER_TYPE_ID = ctype.ID
left outer join CUSTOMER_CONTACT_MAP map on c.id = map.customer_id and map.CONTACT_TYPE_ID = 1
left outer join CUSTOMER_CONTACT ct on ct.ID = map.CONTACT_ID
order by c.NAME;
在我的背景下
protected override void OnModelCreating(ModelBuilder b)
{
b.HasDefaultSchema("SAMSON");
b.Entity<CustomersWithPrimaryContacts>().HasNoKey().ToView("CustomersContacts");
}
可能是当前提供商中的一个bug
我正在使用oracledbv。12.2查看内部的名称套管
ToView
映射?类似于Oracle中的表名,它不应该是大写的吗?好问题,我试过大写
Oracle.ManagedDataAccess.Client.OracleException : ORA-00942: tabel eller view findes ikke
at OracleInternal.ServiceObjects.OracleConnectionImpl.VerifyExecution(Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, SqlStatementType sqlStatementType, Int32 arrayBindCount, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl connectionImpl, Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone)
at OracleInternal.ServiceObjects.OracleCommandImpl.ExecuteReader(String commandText, OracleParameterCollection paramColl, CommandType commandType, OracleConnectionImpl connectionImpl, OracleDataReaderImpl& rdrImpl, Int32 longFetchSize, Int64 clientInitialLOBFS, OracleDependencyImpl orclDependencyImpl, Int64[] scnForExecution, Int64[]& scnFromExecution, OracleParameterCollection& bindByPositionParamColl, Boolean& bBindParamPresent, Int64& internalInitialLOBFS, OracleException& exceptionForArrayBindDML, OracleConnection connection, OracleLogicalTransaction& oracleLogicalTransaction, IEnumerable`1 adrianParsedStmt, Boolean isDescribeOnly, Boolean isFromEF)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteReader(Boolean requery, Boolean fillRequest, CommandBehavior behavior)
at Oracle.ManagedDataAccess.Client.OracleCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.ExecuteReader()
at Oracle.EntityFrameworkCore.Storage.Internal.OracleRelationalCommandBuilderFactory.OracleRelationalCommandBuilder.OracleRelationalCommand.ExecuteReader(RelationalCommandParameterObject parameterObject)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.InitializeReader(DbContext _, Boolean result)
at Oracle.EntityFrameworkCore.Storage.Internal.OracleExecutionStrategy.Execute[TState,TResult](TState state, Func`3 operation, Func`3 verifySucceeded)
at Microsoft.EntityFrameworkCore.Query.Internal.QueryingEnumerable`1.Enumerator.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at Samson.Test.Integrations.FrontPageQuery.GetCustomersWithPrimaryContactsIfAny() in C:\Projects\samson\Samson\Samson.Test\Integrations\FrontPageQuery.cs:line 22