Example #1
0
 public UnitOfWork(DbContext context, IObservableRepository <Reservation, EntityWithEvent> reservations, IObservableRepository <Guest, EntityWithEvent> guestRepository, IObservableRepository <Room, EntityWithEvent> roomRepository)
 {
     _context = (GraphQLDbContext)context;
     ReservationRepository = reservations;
     GuestRepository       = guestRepository;
     RoomRepository        = roomRepository;
 }
Example #2
0
        public MainWindow()
        {
            InitializeComponent();
            observablePropertyChanges = this.ObservablePropertyChanges();

            observableRepository = new ObservableRepository <int>(new TestRepository());
            observableRepository.GetAll().Subscribe((i) => collection.Add(i.ToString()));

            observableRepository.SaveAsync(3);

            this.DataContext = this;
        }
Example #3
0
        void RefreshBranches(IObservableRepository repo)
        {
            Branches.Clear();
            foreach (var branch in repo.Inner.Branches
                     .Select(x => new BranchViewModel {
                Name = x.Name, CanonicalName = x.CanonicalName
            }))
            {
                Branches.Add(branch);
            }

            SelectedBranch = Branches.FirstOrDefault(
                b => b.CanonicalName == repo.Inner.Head.CanonicalName);
        }
        void RefreshBranches(IObservableRepository repo)
        {
            Branches.Clear();
            foreach (var branch in repo.Inner.Branches
                .Select(x => new BranchViewModel { Name = x.Name, CanonicalName = x.CanonicalName }))
            {
                Branches.Add(branch);
            }

            SelectedBranch = Branches.FirstOrDefault(
                b => b.CanonicalName == repo.Inner.Head.CanonicalName);
        }