예제 #1
0
        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            advWorksService = new AdventureWorksLTEntities(new Uri("http://localhost:54961/AdventureWorksDataService.svc"));

            customersViewSource = this.Resources["customersViewSource"]
                                  as System.Windows.Data.CollectionViewSource;
            advWorksService.Customers.BeginExecute(result => customersViewSource.Source = advWorksService.Customers.EndExecute(result), null);
        }
예제 #2
0
 static void Main(string[] args)
 {
     using (AdventureWorksLTEntities db = new AdventureWorksLTEntities())
     {
         var products = db.Products;
         foreach (var product in products)
         {
             Console.WriteLine("Type: {0}\t Product Name: {1}",
                               product.GetType().Name,
                               product.Name);
         }
         Console.ReadLine();
     }
 }
예제 #3
0
 /// <summary>
 /// Initialize DataServiceContext
 /// </summary>
 public ProductGateway()
 {
     serviceUri          = new Uri("http://localhost:50000/AdventureWorks.svc");
     context             = new AdventureWorksLTEntities(serviceUri);
     context.MergeOption = MergeOption.OverwriteChanges;
 }
예제 #4
0
 public ProductGateway()
 {
     context = new AdventureWorksLTEntities();
 }