public async Task <Tuple <Joystick, int> > Load() { var joystick = await _dynService.GetAll(typeof(Joystick)); if (joystick != null && joystick.Any()) { int id = joystick.First().ItemId; return(new Tuple <Joystick, int>((Joystick)await _dynService.Create(id), id)); } return(new Tuple <Joystick, int>(new Joystick { BaudRate = 250000, ComPort = @"com7" }, -1)); }
public async Task <IEnumerable <LoadOptions> > GetAll() { var list = new List <LoadOptions>(); foreach (DynItem item in await _dynItemController.GetAll(typeof(LoadOptions))) { var loadOption = (LoadOptions)await _dynItemController.Create(item.ItemId); loadOption.Id = item.ItemId; list.Add(loadOption); } return(list); }
public async Task <IEnumerable <Joystick> > GetAll() { var list = new List <Joystick>(); foreach (DynItem item in await _dynItemController.GetAll(typeof(Joystick))) { var joystick = (Joystick)await _dynItemController.Create(item.ItemId); joystick.Id = item.ItemId; list.Add(joystick); } return(list); }