EF Core String Fallempfindlichkeit funktioniert nichtC#

Ein Treffpunkt für C#-Programmierer
Guest
 EF Core String Fallempfindlichkeit funktioniert nicht

Post by Guest »

Ich habe ein Stück Code, das in EF Core 2.2 verwendet wird, um das String-Gehäuse zu vergleichen, wie unten gezeigt.

Code: Select all

public async Task DoesItemNumberExists(Guid revisionId, string itemNumber)
{
var doesExist = await _repository.AnyAsync(a => string.Equals(a.ItemNo, itemNumber, StringComparison.Ordinal) && a.SoqHeading_NP.SoqRevisionId == revisionId);

return doesExist;
}
< /code>
Ich führe denselben Code in EF Core 5 aus und die Anwendung stürzt ab. Irgendwelche Hilfe?The LINQ expression 'DbSet()
.Where(s => s.IsDeleted == False)
.Join(
inner: DbSet()
.Where(s0 => s0.SoqRevisionId == __ef_filter__RevisionId_0 && s0.IsDeleted == False),
outerKeySelector: s => EF.Property(s, "SoqHeadingId"),
innerKeySelector: s0 => EF.Property(s0, "Id"),
resultSelector: (o, i) => new TransparentIdentifier(
Outer = o,
Inner = i
))
.Any(s => string.Equals(
a: s.Outer.ItemNo,
b: __itemNumber_0,
comparisonType: Ordinal) && s.Inner.SoqRevisionId == __revisionId_1)' could not be translated. Additional information: Translation of the 'string.Equals' overload with a 'StringComparison' parameter is not supported. See https://go.microsoft.com/fwlink/?linkid=2129535 for more information. Either rewrite the query in a form that can be translated, or switch to client evaluation explicitly by inserting a call to 'AsEnumerable', 'AsAsyncEnumerable', 'ToList', or 'ToListAsync'. See https://go.microsoft.com/fwlink/?linkid=2101038 for more information.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post