public IAsyncAction RemoveAsync(VocabIdentifier vocabID) { if (vocabID == null) { throw new ArgumentNullException("vocabID"); } return m_root.Store.DeleteAsync(vocabID.GetKey()).AsAsyncAction(); }
public IAsyncAction PutAsync(VocabIdentifier vocabID, VocabCodeSet vocab) { if (vocabID == null) { throw new ArgumentNullException("vocabID"); } if (vocab == null) { throw new ArgumentNullException("vocab"); } string key = vocabID.GetKey(); return m_root.Store.PutAsync(key, vocab).AsAsyncAction(); }
private async Task<bool> IsStale(VocabIdentifier vocabID, TimeSpan maxAge) { DateTimeOffset dt = await m_root.Store.GetUpdateDateAsync(vocabID.GetKey()); TimeSpan offset = DateTimeOffset.Now.Subtract(dt); return (offset >= maxAge); }
private async Task<VocabCodeSet> GetVocabAsync(VocabIdentifier vocabID) { string key = vocabID.GetKey(); return (VocabCodeSet) await m_root.Store.GetAsync(key, typeof (VocabCodeSet)); }