Révision 6f451cc1 GES_PAC/ViewModel/PlaceViewModel.cs

Voir les différences:

GES_PAC/ViewModel/PlaceViewModel.cs
1 1
using GES_PAC.Model;
2
using Microsoft.EntityFrameworkCore;
2 3
using System.Collections.ObjectModel;
3 4

  
4

  
5 5
namespace GES_PAC.ViewModel
6 6
{
7 7
    public class PlaceViewModel
......
17 17
        
18 18
        #region Constructeur
19 19
        private PlaceViewModel() {
20
            Places.Add(new Lieu("Elevage Langlade", "INRAE", "Mouton")); // Ajout d'un lieu par défaut pour les tests
20
            _ = InitAsync();
21
        }
22
        #endregion
23
        #region Méthodes
24
        public async Task InitAsync()
25
        {
26
            var lieux = await App.Db.Lieu.ToListAsync();
27
            foreach (var l in lieux)
28
                Places.Add(l);
21 29
        }
22 30
        #endregion
23 31
    }

Formats disponibles : Unified diff