Skip to content

Commit

Permalink
fix(payee): Use StartsWith(string), which EF Core can translate
Browse files Browse the repository at this point in the history
Resolves AB#1964
  • Loading branch information
jcoliz committed Jun 30, 2024
1 parent 3830462 commit ae0a918
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion YoFi.Core/Repositories/PayeeRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ public Task<string> GetCategoryMatchingPayeeAsync(string Name)
if (!string.IsNullOrEmpty(Name))
{
IQueryable<Payee> payees = payeecache?.AsQueryable<Payee>() ?? All;
regexpayees = payees.Where(x => x.Name.StartsWith('/') && x.Name.EndsWith('/'));

// Note that EFCore cannot translate StartsWith(char)
#pragma warning disable CA1866 // Use char overload
regexpayees = payees.Where(x => x.Name.StartsWith("/") && x.Name.EndsWith("/"));
#pragma warning restore CA1866 // Use char overload

// Product Backlog Item 871: Match payee on regex, optionally
Payee payee = null;
Expand Down

0 comments on commit ae0a918

Please sign in to comment.