Exemple #1
0
        public BindingList <GetEmployeeResponse> GetDataSource()
        {
            var getEmployeeList = Task.Run(() => HttpRequests.GetEmployees());

            try
            {
                getEmployeeList.Wait();
            }
            catch
            {
                MessageBox.Show(string.Format("Connection to Server Status: {0}", getEmployeeList.Status.ToString()));
                return(null);
            }

            var result = new BindingList <GetEmployeeResponse>();

            foreach (var employee in getEmployeeList.Result)
            {
                result.Add(employee);
            }

            return(result);
        }