protected override bool OtherSinceDatesDidntChange(ISinceParameters old, ISinceParameters next, DateTimeOffset at) => next.Workspaces == old.Workspaces && next.Clients == old.Clients && next.Projects == at && next.Tags == old.Tags && next.Tasks == old.Tasks && next.TimeEntries == old.TimeEntries;
public void SetValuesFrom(ISinceParameters parameters) { Workspaces = parameters.Workspaces; Tags = parameters.Tags; Clients = parameters.Clients; Projects = parameters.Projects; Tasks = parameters.Tasks; TimeEntries = parameters.TimeEntries; }
public FetchObservables(ISinceParameters sinceParameters, IObservable <List <IWorkspace> > workspaces, IObservable <List <IClient> > clients, IObservable <List <IProject> > projects, IObservable <List <ITimeEntry> > timeEntries ) { SinceParameters = sinceParameters; Workspaces = workspaces; Clients = clients; Projects = projects; TimeEntries = timeEntries; }
protected override FetchObservables CreateObservables( ISinceParameters since = null, List <ITimeEntry> timeEntries = null) => new FetchObservables( since ?? new SinceParameters(null), Observable.Return(new List <IWorkspace>()), Observable.Return(new List <IWorkspaceFeatureCollection>()), Observable.Return(new List <IClient>()), Observable.Return(new List <IProject>()), Observable.Return(timeEntries), Observable.Return(new List <ITag>()), Observable.Return(new List <ITask>()));
protected override FetchObservables CreateObservables( ISinceParameters since = null, List <IProject> projects = null) => new FetchObservables( since ?? new SinceParameters(null), Observable.Return(new List <IWorkspace>()), Observable.Return(new List <IWorkspaceFeatureCollection>()), Observable.Return(Substitute.For <IUser>()), Observable.Return(new List <IClient>()), Observable.Return(projects), Observable.Return(new List <ITimeEntry>()), Observable.Return(new List <ITag>()), Observable.Return(new List <ITask>()), Observable.Return(Substitute.For <IPreferences>()));
public SinceParameters( ISinceParameters since, DateTimeOffset?workspaces = null, DateTimeOffset?tags = null, DateTimeOffset?clients = null, DateTimeOffset?projects = null, DateTimeOffset?tasks = null, DateTimeOffset?timeEntries = null) { Workspaces = workspaces ?? since?.Workspaces; Tags = tags ?? since?.Tags; Clients = clients ?? since?.Clients; Projects = projects ?? since?.Projects; Tasks = tasks ?? since?.Tasks; TimeEntries = timeEntries ?? since?.TimeEntries; }
protected FetchObservables CreateFetchObservables( FetchObservables old, ISinceParameters sinceParameters, IObservable <List <IWorkspace> > workspaces = null, IObservable <List <IWorkspaceFeatureCollection> > workspaceFeatures = null, IObservable <List <IClient> > clients = null, IObservable <List <IProject> > projects = null, IObservable <List <ITimeEntry> > timeEntries = null, IObservable <List <ITag> > tags = null, IObservable <List <ITask> > tasks = null) => new FetchObservables( old?.SinceParameters ?? sinceParameters, old?.Workspaces ?? workspaces, old?.WorkspaceFeatures ?? workspaceFeatures, old?.Clients ?? clients, old?.Projects ?? projects, old?.TimeEntries ?? timeEntries, old?.Tags ?? tags, old?.Tasks ?? tasks);
public FetchObservables(ISinceParameters sinceParameters, IObservable <List <IWorkspace> > workspaces, IObservable <List <IWorkspaceFeatureCollection> > workspaceFeatures, IObservable <List <IClient> > clients, IObservable <List <IProject> > projects, IObservable <List <ITimeEntry> > timeEntries, IObservable <List <ITag> > tags, IObservable <List <ITask> > tasks ) { SinceParameters = sinceParameters; Workspaces = workspaces; WorkspaceFeatures = workspaceFeatures; Clients = clients; Projects = projects; TimeEntries = timeEntries; Tags = tags; Tasks = tasks; }
public void Set(ISinceParameters parameters) { doTransaction(p => p.SetValuesFrom(parameters)); }
protected abstract DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <TDatabaseInterface> entities);
protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated) => new SinceParameters(old, projects: lastUpdated);
protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseProject> entities) => entities.Select(p => p?.At).Where(d => d.HasValue).DefaultIfEmpty(old.Projects).Max();
protected abstract FetchObservables CreateObservables(ISinceParameters since = null, List <TInterface> entities = null);
protected abstract bool OtherSinceDatesDidntChange(ISinceParameters old, ISinceParameters next, DateTimeOffset at);
protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabaseWorkspaceFeatureCollection> entities) => null;
public FetchObservables(FetchObservables old, ISinceParameters sinceParameters) : this(sinceParameters, old.Workspaces, old.WorkspaceFeatures, old.Clients, old.Projects, old.TimeEntries, old.Tags, old.Tasks) { }
protected override ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated) => old;
protected override DateTimeOffset?LastUpdated(ISinceParameters old, IEnumerable <IDatabasePreferences> entities) => null;
protected abstract ISinceParameters UpdateSinceParameters(ISinceParameters old, DateTimeOffset?lastUpdated);