I'm having a problem where the below query is taking around 700ms to execute. It's in a loop and gets called 100+ times so it's taking forever.
Model:
public class ReleaseDates
{
public int Id { get; set; }
public string MovieName { get; set; }
public string Country { get; set; }
public DateTime ReleaseDate { get; set; }
public string AlternateSource { get; set; }
}
Query:
public async Task<List<ReleaseDates>> GetReleaseDatesAsync(string movieName)
{
return await Db.ReleaseDates.Where(x => x.MovieName == movieName && string.IsNullOrEmpty(x.AlternateSource)).ToListAsync();
}
Any suggestions how to speed this up?