public Task <NoteTake> GetByIDAsync(string id) { NoteTake entry = null; entries.TryGetValue(id, out entry); return(Task.FromResult <NoteTake>(entry)); }
public static void LoadData(this INoteEntryStorage store) { var a = new NoteTake { Title = "Sprint Planning Meeting", Text = "1. Scope 2. Backlog 3. Duration" }; var b = new NoteTake { Title = "Daily Scrum Stand-up", Text = "1. Yesterday 2.Today 3. Impediments" }; var c = new NoteTake { Title = "Sprint Retrospective", Text = "1. Reflection 2. Actions" }; Task.WhenAll( store.AddAsync(a), store.AddAsync(b), store.AddAsync(c)) .ConfigureAwait(false); }
public async Task DeleteAsync(NoteTake entry) { await InitializeAsync(); if (loadedNotes.Remove(entry)) { await SaveDataAsync(filename, loadedNotes); } }
public async Task UpdateAsync(NoteTake entry) { await InitializeAsync(); if (!loadedNotes.Contains(entry)) { throw new Exception($"NoteTake {entry.Title} was not found in the {nameof(FileEntryStorage)}. Did you forget to add it?"); } await SaveDataAsync(filename, loadedNotes); }
public async Task AddAsync(NoteTake entry) { await InitializeAsync(); if (!loadedNotes.Any(ne => ne.ID == entry.ID)) { loadedNotes.Add(entry); await SaveDataAsync(filename, loadedNotes); } }
public Task DeleteAsync(NoteTake entry) { entries.Remove(entry.ID); return(Task.CompletedTask); }
public Task UpdateAsync(NoteTake entry) { return(Task.CompletedTask); }
public Task AddAsync(NoteTake entry) { entries.Add(entry.ID, entry); return(Task.CompletedTask); }