public void Test_ClientTRK_ReadTagsTank() { try { ClientTRK client = new ClientTRK(); Tank tank = client.ReadTagsTank(); Console.WriteLine("------------------ Tank ---------------------------"); if (tank != null) { Console.WriteLine("tank.dens - {0}", tank.dens); Console.WriteLine("tank.mass - {0}", tank.mass); Console.WriteLine("tank.level - {0}", tank.level); Console.WriteLine("tank.temp - {0}", tank.temp); Console.WriteLine("tank.volume - {0}", tank.volume); Console.WriteLine("tank.water_level - {0}", tank.water_level); Console.WriteLine("tank.water_volume - {0}", tank.water_volume); } else { Console.WriteLine("tank = null"); } Console.WriteLine("--------------------------------------------------"); } catch (Exception e) { Console.WriteLine(e); } }
public IHttpActionResult GetReadTagsTank() { try { Tank tank = client.ReadTagsTank(); if (tank == null) { return(NotFound()); } return(Ok(tank)); } catch (Exception e) { String.Format("Ошибка выполнения метода API:GetReadTagsTank()").SaveError(e); return(NotFound()); } }