added missing GetResourceById methods.

This commit is contained in:
kay.one 2013-08-26 00:14:46 -07:00
commit 317586c102
3 changed files with 27 additions and 3 deletions

View file

@ -137,6 +137,7 @@ namespace NzbDrone.Api.REST
private get { return _createResource; }
set
{
EnsureGetByIdRoute();
_createResource = value;
Post[ROOT_ROUTE] = options =>
{
@ -147,6 +148,15 @@ namespace NzbDrone.Api.REST
}
}
private void EnsureGetByIdRoute()
{
if (GetResourceById == null)
{
throw new InvalidOperationException(
"GetResourceById route must be defined before defining Create/Update routes.");
}
}
protected Action<TResource> UpdateResource
{
private get { return _updateResource; }