0

I'm developing a .net core web API which use database oracle and data provider devart when I try to get some data on login operation I have a this problem

{"ORA-00923: FROM keyword not found where expected"}

my code drop catch on this line throw exception

var result = db.tables.Where(x => x.code== userParams.code&& x.password == userParams.Password).FirstOrDefault();

I changed after the where funtion I tried

.First()
.SingleOrDefault()
.FirstOrDefault()

Also, I tried then that worked but I think this functions illogical

.SingleOrDefault()
.Take(1)

My versions

.net core 3.1
OracleDB version 11g
EFCore Devart 
EF 3.1

Anyone can know anything about this problem?

Nguyễn Văn Phong
  • 13,506
  • 17
  • 39
  • 56
errorau
  • 2,121
  • 1
  • 14
  • 38
  • is "code" your primary key? Or how is your relations defined? – Kim Bay Andersen Jan 17 '20 at 14:20
  • No code like a nickname or username – errorau Jan 17 '20 at 14:38
  • 1
    Confirm that you are using the newest build https://www.nuget.org/packages/Devart.Data.Oracle.EFCore/9.10.909. If this doesn't help, enable the dbMonitor tool and specify the SQL statement that fails to execute: https://www.devart.com/dotconnect/oracle/docs/?dbmonitor.html. – Devart Jan 17 '20 at 19:00

2 Answers2

1

Thank you @Devart I updated my Devart.Data.Oracle.EFCore version ith this version. It worked now :) https://www.nuget.org/packages/Devart.Data.Oracle.EFCore/9.10.909

errorau
  • 2,121
  • 1
  • 14
  • 38
0

If SingleOrDefault is working i would redifne your query like this

var result = db.tables.SingleOrDefault(x => x.code == userParams.code && x.password == userParams.Password);

By doing so, i also think you are skipping som unnecessarily sub querying.

Kim Bay Andersen
  • 279
  • 2
  • 12