Home > Net >  EF oracle guid type comparison is always false
EF oracle guid type comparison is always false

Time:10-08

 
Guid RSVID=New Guid (" XXXXXXXXXXX ");
Var m=db table. FirstOrDefault (f=& gt; F.R SVID==RSVID);//never matched here, f.R SVID==RSVID is always false


Entity f.R SVID is GUID type
Database is ORACLE field type is RAW (16) the default sys_guid ()

Select * from table where RSVID="XXXXXXXXXXX" direct use of SQL statement is no problem, do not check ef is why why

CodePudding user response:

Not how to use oracle, but RAW (16) represents the length of the 16?
But the guid is 36, not - there are 32 bit

CodePudding user response:

Length, case sensitive

CodePudding user response:

Param. Add (" @ RsvId, "RsvId MyDbType. Raw);//must be combined with type, ORACLE's format is different

CodePudding user response:

After the two tostring () to see where is not the same,

CodePudding user response:

Guid initialization can't write? I remember a var Id=Guid. NewGuid (); In order to generate a unique Guid; New words like is always 0 directly?
  • Related