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; }
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; }
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); }