Exemple #1
0
        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);
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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);
        }
Exemple #4
0
        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));
        }
Exemple #5
0
        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);
        }