/
TableEntity.Dictionary.cs
71 lines (54 loc) · 2.87 KB
/
TableEntity.Dictionary.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
using System.Collections;
using System.Collections.Generic;
namespace Azure.Data.Tables
{
public partial class TableEntity : IDictionary<string, object>
{
/// <summary>
/// Gets or sets the entity's property, given the name of the property.
/// </summary>
/// <param name="key">A string containing the name of the property.</param>
/// <returns>The property value typed as an object.</returns>
public object this[string key]
{
get { return GetValue(key); }
set { SetValue(key, value); }
}
/// <inheritdoc />
public ICollection<string> Keys => _properties.Keys;
/// <inheritdoc cref="IDictionary{TKey, TValue}.Values" />
ICollection<object> IDictionary<string, object>.Values => _properties.Values;
/// <inheritdoc />
public int Count => _properties.Count;
/// <inheritdoc cref="ICollection{T}.IsReadOnly" />
bool ICollection<KeyValuePair<string, object>>.IsReadOnly => _properties.IsReadOnly;
/// <inheritdoc />
public void Add(string key, object value) => SetValue(key, value);
/// <inheritdoc />
public bool ContainsKey(string key) => _properties.ContainsKey(key);
/// <inheritdoc />
public bool Remove(string key) => _properties.Remove(key);
/// <inheritdoc />
public bool TryGetValue(string key, out object value) => _properties.TryGetValue(key, out value);
/// <inheritdoc cref="ICollection{T}.Add(T)" />
void ICollection<KeyValuePair<string, object>>.Add(KeyValuePair<string, object> item) => SetValue(item.Key, item.Value);
/// <inheritdoc />
public void Clear() => _properties.Clear();
/// <inheritdoc cref="ICollection{T}.Contains(T)"/>
bool ICollection<KeyValuePair<string, object>>.Contains(KeyValuePair<string, object> item) => _properties.Contains(item);
/// <inheritdoc cref="ICollection{T}.CopyTo(T[], int)" />
void ICollection<KeyValuePair<string, object>>.CopyTo(KeyValuePair<string, object>[] array, int arrayIndex) => _properties.CopyTo(array, arrayIndex);
/// <inheritdoc cref="ICollection{T}.Remove(T)" />
bool ICollection<KeyValuePair<string, object>>.Remove(KeyValuePair<string, object> item) => _properties.Remove(item);
/// <summary>
/// Gets the enumerator for the <see cref="TableEntity"/> properties.
/// </summary>
IEnumerator<KeyValuePair<string, object>> IEnumerable<KeyValuePair<string, object>>.GetEnumerator() => _properties.GetEnumerator();
/// <summary>
/// Gets the enumerator for the <see cref="TableEntity"/> properties.
/// </summary>
IEnumerator IEnumerable.GetEnumerator() => _properties.GetEnumerator();
}
}