GetMembersByPropertyValue Not Working?

Hi

I’m implementing a 2FA flow for Members, and have stumbled upon what looks like a bug…

At a point in my code, I need to get a member by their secret (a guid stored in lowercase). I tried the GetMembersByPropertyValue() function within the IMemberService, but it returns null, so I’ve resorted to getting all and finding by property value. See below a comparison:

var theMemberByVal = _memberService.GetMembersByPropertyValue(nameof(Member.EmailAuthSecret), secret);
var theMember = _memberService.GetAll(0, int.MaxValue, out long tot).FirstOrDefault(m => m.GetValue(nameof(Member.EmailAuthSecret))?.ToString() == secret);

Running the above, theMemberByVal is null, whereas theMember is the member I expect to find. Am I doing something wrong?

Works fine on my solution. Could it be a case of one method being case sensitive and not the other?

Think if you want to match the alias casing you could do nameof(Member.EmailAuthSecret).ToFirstLower() or simply copy the alias from the backoffice into your code for a quick test.

That’s a good shout. I’d wrongly assumed nameof(Member.EmailAuthSecret) would give me the alias, as it works in GetValue() . I’ll be more careful using it in future.