示例#1
0
文件: Program.cs 项目: vonfrank/Exam
        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();
            }
        }
示例#2
0
 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;
         }));
     }
 }