sonarr-repo-only/NzbDrone.Api/NzbDroneRestModule.cs

16 lines
450 B
C#
Raw Normal View History

2013-04-20 22:14:41 +00:00
using NzbDrone.Api.REST;
using NzbDrone.Api.Validation;
namespace NzbDrone.Api
{
public abstract class NzbDroneRestModule<TResource> : RestModule<TResource> where TResource : RestResource, new()
{
protected NzbDroneRestModule(string resource)
: base("/api/" + resource.Trim('/'))
{
PostValidator.RuleFor(r => r.Id).IsZero();
PutValidator.RuleFor(r => r.Id).ValidId();
}
}
}