public byte[] GetImg(int id) { var c = camers; // AntiRace CameraWithImg img = c.FirstOrDefault(x => x.Camera.Id == id); return(img?.Img); }
public byte[] GetImg(int brigadeId, int cameraNumber) { var c = camers; // AntiRace CameraWithImg img = c.FirstOrDefault(x => x.Camera.BrigadeId == brigadeId && x.Camera.Num == cameraNumber); return(img?.Img); }
private void DownloadImg(CameraWithImg item, Uri src) { try { using (var client = new WebClient()) { byte[] data = client.DownloadData(src); item.Img = data; } } catch (Exception e) { logger.Error(e, $"Can not downloaded img from {src.AbsolutePath}"); } }