static void Main(string[] args) { using (var db = new DataModel()) { var users = from u in db.UsersVF select u; foreach (UsersVF user in users) { Console.WriteLine(user.userFirstname + " has username: " + user.userName); } Console.ReadLine(); } }
private void FetchUsers() { using (var db = new DataModel()) { var users = from u in db.UsersVF select u; System.Threading.Thread.Sleep(5000); this.Dispatcher.Invoke((Action)(() => { foreach(UsersVF user in users) { listView.Items.Add(user); } progressbar.IsIndeterminate = false; })); } }