public Task DeleteRecordAsync(int storageHandle, string type, string id) { var record = StoredRecords.SingleOrDefault(x => x.Id == id && x.Type == type); StoredRecords.Remove(record); return(Task.CompletedTask); }
public Task UpdateRecordTagsAsync(int storageHandle, string type, string id, string tagsJson) { var record = StoredRecords.Single(x => x.Id == id && x.Type == type); record.Tags = tagsJson; return(Task.CompletedTask); }
public Task UpdateRecordValueAsync(int storageHandle, string type, string id, byte[] value) { var record = StoredRecords.Single(x => x.Id == id && x.Type == type); record.Value = value; return(Task.CompletedTask); }
public Task <int> GetRecordAsync(int storageHandle, string type, string id, string optionsJson) { var record = StoredRecords.Single(x => x.Id == id && x.Type == type); var nextRecordHandle = RecordHandles.Keys.MaxOrDefault() + 1; RecordHandles.Add(nextRecordHandle, record); return(Task.FromResult(nextRecordHandle)); }
public Task AddRecordAsync(int storageHandle, string type, string id, byte[] value, string tagsJson) { var record = new StorageRecord { Id = id, Type = type, Value = value, Tags = tagsJson }; StoredRecords.Add(record); return(Task.CompletedTask); }