When I execute following code, I get an error:
System.InvalidOperationException: The LINQ expression 'DbSet.Where(u => u.NormalizedEmail == __ToLower_0 && u.PasswordHash.SequenceEqual(__pass_1))' could not be translated
But it was working fine in .NET Core 2.2. Error is raised in .NET Core 3.1.
loginCreds.Password = loginCreds.Password.ToLower();
var pass = Helper.ComputeHash(loginCreds.Password);
var usr = await _context.Users
.FirstOrDefaultAsync(u => u.NormalizedEmail == loginCreds.Email
&& u.PasswordHash.SequenceEqual(pass));
But, when I replace u.PasswordHash.SequenceEqual(pass) with u.PasswordHash == new byte[16] (just for testing), it works. So, problem is the SequenceEqual(byte[] byte) method.
How can I solve this?