public async Task <ActionResult> DeleteRouteByObjectId(string id) { var routeModel = await _repository.GetObjectByIdAsync(id); if (routeModel != null) { await _repository.RemoveObjectAsync(routeModel); return(Ok("Successfully deleted from collection!")); } return(NotFound()); }
public async Task <ActionResult> DeleteRuuviStationByDeviceId(string id) { var stations = await GetAllObjectsAsync(); var station = stations.Find(doc => doc.DeviceId == id); if (station != null) { await _repository.RemoveObjectAsync(station); return(Ok("Successfully deleted from collection!")); } return(NotFound()); }