public MainWindow()
 {
     foodDao = new FoodDAOMSSQL();
     InitializeComponent();
     foods            = foodDao.GetAllFoods();
     grid.ItemsSource = foods;
 }
Exemple #2
0
        public HttpResponseMessage Get()
        {
            List <Food>  foods   = new List <Food>();
            FoodDAOMSSQL foodDao = new FoodDAOMSSQL();

            foods = foodDao.GetAllFoods();
            HttpResponseMessage msg = Request.CreateResponse(HttpStatusCode.OK, foods);

            return(msg);
        }
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     foods            = foodDao.GetAllFoods();
     grid.ItemsSource = foods;
 }