got basic relationships working

added support for embedded documents.
This commit is contained in:
kay.one 2013-03-25 22:51:56 -07:00
parent b6fc731db8
commit fc641baab3
51 changed files with 359 additions and 127 deletions

View file

@ -124,6 +124,7 @@ namespace NzbDrone.Core.Test.Framework
void InsertMany<T>(IEnumerable<T> items) where T : ModelBase, new();
void Insert<T>(T item) where T : ModelBase, new();
IEnumerable<T> All<T>() where T : ModelBase, new();
T Single<T>() where T : ModelBase, new();
void Update<T>(T childModel) where T : ModelBase, new();
void Delete<T>(T childModel) where T : ModelBase, new();
}
@ -152,6 +153,11 @@ namespace NzbDrone.Core.Test.Framework
return new BasicRepository<T>(_dbConnection).All();
}
public T Single<T>() where T : ModelBase, new()
{
return All<T>().SingleOrDefault();
}
public void Update<T>(T childModel) where T : ModelBase, new()
{
new BasicRepository<T>(_dbConnection).Update(childModel);