public async Task <IActionResult> Ping(string device, string info = "") { if (string.IsNullOrEmpty(device)) { ModelState.AddModelError("device", "Device not set"); return(BadRequest()); } try { if (!string.IsNullOrEmpty(info)) { await deviceRepository.SetInfo(device, info); } } catch (Exception e) { Console.WriteLine(e.Message); } var ping = await pingRepository.Ping(device); await blockRepository.ProccessPing(ping); return(Ok()); }
public async Task <string> Ping() { return(await PingRepository.Ping()); }