added support for 0 based sequential ids to our object db.

This commit is contained in:
kay.one
2013-02-15 19:50:22 -08:00
parent a0c7ccfe7c
commit c6fa3cc02b
17 changed files with 375 additions and 29 deletions

View File

@@ -6,9 +6,9 @@ namespace NzbDrone.Core.Datastore
public interface IBasicRepository<TModel>
{
List<TModel> All();
TModel Get(long rootFolderId);
TModel Get(int rootFolderId);
TModel Add(TModel rootFolder);
void Delete(long rootFolderId);
void Delete(int rootFolderId);
}
public class BasicRepository<TModel> : IBasicRepository<TModel> where TModel : BaseRepositoryModel, new()
@@ -25,7 +25,7 @@ namespace NzbDrone.Core.Datastore
return EloqueraDb.AsQueryable<TModel>().ToList();
}
public TModel Get(long id)
public TModel Get(int id)
{
return EloqueraDb.AsQueryable<TModel>().Single(c => c.Id == id);
}
@@ -35,7 +35,7 @@ namespace NzbDrone.Core.Datastore
return EloqueraDb.Insert(model);
}
public void Delete(long id)
public void Delete(int id)
{
var itemToDelete = Get(id);
EloqueraDb.Delete(itemToDelete);