public string ReadFromBox(int number) { var box = Boxes.FirstOrDefault(n => n.Number == number); if (box == null) { return(string.Empty); } return(box.Message); }
public async Task <Box> FindBox(QRCodeWrapper oQRCode) { CurrentBox = Boxes.FirstOrDefault(oBox => oBox.QRCode == oQRCode); if (CurrentBox == null) { CurrentBox = new Box(this, oQRCode); await MoveFolder.CreateFolderAsync(CurrentBox.ImageFolder); Boxes.Add(CurrentBox); } return(CurrentBox); }
public Box GetBox(int number) { var targetBox = Boxes.FirstOrDefault(n => n.Number == number); if (targetBox != null) { return(targetBox); } Boxes.Add(new Box { Number = number }); SaveChanges(); return(Boxes.FirstOrDefault(n => n.Number == number)); }