Performance Improvements (#2449)

This commit is contained in:
Joe Milazzo 2023-11-21 13:20:36 -06:00 committed by GitHub
parent 419a827d42
commit 5ed1eebd26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 389 additions and 132 deletions

View file

@ -23,6 +23,7 @@ public interface IPersonRepository
Task<IList<PersonDto>> GetAllPeopleDtosForLibrariesAsync(List<int> libraryIds, int userId);
Task<int> GetCountAsync();
Task<IList<Person>> GetAllPeopleByRoleAndNames(PersonRole role, IEnumerable<string> normalizeNames);
}
public class PersonRepository : IPersonRepository
@ -80,6 +81,13 @@ public class PersonRepository : IPersonRepository
return await _context.Person.CountAsync();
}
public async Task<IList<Person>> GetAllPeopleByRoleAndNames(PersonRole role, IEnumerable<string> normalizeNames)
{
return await _context.Person
.Where(p => p.Role == role && normalizeNames.Contains(p.NormalizedName))
.ToListAsync();
}
public async Task<IList<Person>> GetAllPeople()
{