コード例 #1
0
        public MainWindow()
        {
            InitializeComponent();

            // Initialize the client cache and the client scope.
            _clientCache = new EntityClientCache(new NORTHWNDEntities());
            _scope       = new EntityClientScope(_clientCache);

            // Bind a combo box to the list of cities
            // using a live view of customers grouped by city.
            comboCity.ItemsSource =
                (from c in _scope.GetItems <Customer>()
                 group c by c.City into g
                 orderby g.Key
                 select new
            {
                City = g.Key,
                Customers = g
            }).AsDynamic();
        }