Changed db stuff

This commit is contained in:
2022-07-14 19:31:53 -04:00
parent 450a05fab1
commit 5402923e9f
9 changed files with 40 additions and 16 deletions

View File

@@ -19,4 +19,19 @@ public class NovelRepository : BaseRepository<Novel>, INovelRepository
.Include(i => i.Tags);
}
public async Task<Novel?> GetNovel(string url)
{
return await GetIncluded(i => i.Url == url);
}
public async Task<IEnumerable<Novel>> LookupNovelsByName(string name)
{
return await GetWhereIncluded(n => n.Title.Contains(name));
}
public async Task<IEnumerable<Novel>> LookupNovelsByTag(string tag)
{
return await GetWhereIncluded(n => n.Tags.Any(nt => nt.TagValue.Contains(tag)));
}
}