private dynamic DeleteDevice(dynamic parameters) { this.RequiresAuthentication(); this.RequiresAnyClaim(new[] { "superuser", "device-delete-all", string.Format("device-delete-{0}", (int)parameters.id) }); return(SerializeDevice(ModuleHelpers.Delete <Device>(_connection, (int)parameters.id)) ?? HttpStatusCode.NoContent); }
private Task <dynamic> DeleteAuth(dynamic parameters, CancellationToken ct) { return(Task <dynamic> .Factory.StartNew(() => { this.RequiresAuthentication(); ModuleHelpers.Delete <Session>(_connection, ((Identity)Context.CurrentUser).Session.Id); return HttpStatusCode.NoContent; }, ct)); }
private dynamic DeleteSensor(dynamic parameters) { return(SerializeSensor(ModuleHelpers.Delete <Sensor>(_connection, (int)parameters.id)) ?? HttpStatusCode.NoContent); }