updated logic for query episodes by title. added ability to query quotes by narrator

This commit is contained in:
StevanFreeborn
2022-06-23 15:43:39 -05:00
parent 0957b27863
commit 911c199ba2
3 changed files with 8 additions and 2 deletions
@@ -1,4 +1,5 @@
using MongoDB.Driver;
using MongoDB.Driver.Linq;
using server.Models;
namespace server.Persistence.Repositories
@@ -18,6 +19,12 @@ namespace server.Persistence.Repositories
try
{
var query = _context.Quotes.AsQueryable();
if (filter?.Narrator != null)
{
query = query.Where(quote => quote.Narrator!.ToLower().Contains(filter.Narrator.ToLower()));
}
return await query.ToListAsync();
}
catch (Exception e)