Update QuoteRepository.cs

handle all standard cases (matches text that contains the exact, upper, or lowercase forms of the input text to search)
This commit is contained in:
Shikhir Arora 2017-03-02 03:57:39 -05:00 committed by GitHub
parent 6773d1e86d
commit 72de465c34

View File

@ -27,7 +27,8 @@ namespace NadekoBot.Services.Database.Repositories.Impl
{
var rngk = new NadekoRandom();
lowertext = text.ToLowerInvariant();
return _set.Where(q => q.Text.Contains(text) || q.Text.Contains(lowertext) && q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rngk.Next()).FirstOrDefaultAsync();
uppertext = text.ToUpperInvariant();
return _set.Where(q => q.Text.Contains(text) || q.Text.Contains(lowertext) || q.Text.Contains(uppertext) && q.GuildId == guildId && q.Keyword == keyword).OrderBy(q => rngk.Next()).FirstOrDefaultAsync();
}
}
}