mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
stuff we did :D
This commit is contained in:
parent
32701d5e84
commit
4cd75cd8aa
29 changed files with 648 additions and 479 deletions
|
@ -29,10 +29,15 @@ namespace NzbDrone.Core.Datastore
|
|||
bool HasItems();
|
||||
void DeleteMany(IEnumerable<int> ids);
|
||||
void SetFields(TModel model, params Expression<Func<TModel, object>>[] properties);
|
||||
TModel Single();
|
||||
}
|
||||
|
||||
public class BasicRepository<TModel> : IBasicRepository<TModel> where TModel : ModelBase, new()
|
||||
{
|
||||
|
||||
//TODO: add assertion to make sure model properly mapped
|
||||
|
||||
|
||||
private readonly IDataMapper _dataMapper;
|
||||
|
||||
public BasicRepository(IDatabase database)
|
||||
|
@ -78,6 +83,11 @@ namespace NzbDrone.Core.Datastore
|
|||
}
|
||||
|
||||
public TModel SingleOrDefault()
|
||||
{
|
||||
return All().SingleOrDefault();
|
||||
}
|
||||
|
||||
public TModel Single()
|
||||
{
|
||||
return All().Single();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue