|
1 | 1 | using System; |
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Linq; |
| 4 | +using System.Net; |
4 | 5 | using System.Text; |
5 | 6 | using System.Threading.Tasks; |
6 | 7 | using Enyim.Caching.Memcached; |
@@ -40,37 +41,37 @@ public CasResult<bool> Cas(StoreMode mode, string key, object value, TimeSpan va |
40 | 41 |
|
41 | 42 | public CasResult<bool> Cas(StoreMode mode, string key, object value, DateTime expiresAt, ulong cas) |
42 | 43 | { |
43 | | - throw new NotImplementedException(); |
| 44 | + return new CasResult<bool>(); |
44 | 45 | } |
45 | 46 |
|
46 | 47 | public ulong Decrement(string key, ulong defaultValue, ulong delta) |
47 | 48 | { |
48 | | - throw new NotImplementedException(); |
| 49 | + return default(ulong); |
49 | 50 | } |
50 | 51 |
|
51 | 52 | public ulong Decrement(string key, ulong defaultValue, ulong delta, TimeSpan validFor) |
52 | 53 | { |
53 | | - throw new NotImplementedException(); |
| 54 | + return default(ulong); |
54 | 55 | } |
55 | 56 |
|
56 | 57 | public CasResult<ulong> Decrement(string key, ulong defaultValue, ulong delta, ulong cas) |
57 | 58 | { |
58 | | - throw new NotImplementedException(); |
| 59 | + return new CasResult<ulong>(); |
59 | 60 | } |
60 | 61 |
|
61 | 62 | public ulong Decrement(string key, ulong defaultValue, ulong delta, DateTime expiresAt) |
62 | 63 | { |
63 | | - throw new NotImplementedException(); |
| 64 | + return default(ulong); |
64 | 65 | } |
65 | 66 |
|
66 | 67 | public CasResult<ulong> Decrement(string key, ulong defaultValue, ulong delta, TimeSpan validFor, ulong cas) |
67 | 68 | { |
68 | | - throw new NotImplementedException(); |
| 69 | + return new CasResult<ulong>(); |
69 | 70 | } |
70 | 71 |
|
71 | 72 | public CasResult<ulong> Decrement(string key, ulong defaultValue, ulong delta, DateTime expiresAt, ulong cas) |
72 | 73 | { |
73 | | - throw new NotImplementedException(); |
| 74 | + return new CasResult<ulong>(); |
74 | 75 | } |
75 | 76 |
|
76 | 77 | public void Dispose() |
@@ -118,72 +119,72 @@ public async Task<T> GetValueAsync<T>(string key) |
118 | 119 |
|
119 | 120 | public IDictionary<string, CasResult<object>> GetWithCas(IEnumerable<string> keys) |
120 | 121 | { |
121 | | - throw new NotImplementedException(); |
| 122 | + return new Dictionary<string, CasResult<object>>(); |
122 | 123 | } |
123 | 124 |
|
124 | 125 | public CasResult<object> GetWithCas(string key) |
125 | 126 | { |
126 | | - throw new NotImplementedException(); |
| 127 | + return new CasResult<object>(); |
127 | 128 | } |
128 | 129 |
|
129 | 130 | public CasResult<T> GetWithCas<T>(string key) |
130 | 131 | { |
131 | | - throw new NotImplementedException(); |
| 132 | + return new CasResult<T>(); |
132 | 133 | } |
133 | 134 |
|
134 | 135 | public ulong Increment(string key, ulong defaultValue, ulong delta) |
135 | 136 | { |
136 | | - throw new NotImplementedException(); |
| 137 | + return default(ulong); |
137 | 138 | } |
138 | 139 |
|
139 | 140 | public ulong Increment(string key, ulong defaultValue, ulong delta, TimeSpan validFor) |
140 | 141 | { |
141 | | - throw new NotImplementedException(); |
| 142 | + return default(ulong); |
142 | 143 | } |
143 | 144 |
|
144 | 145 | public CasResult<ulong> Increment(string key, ulong defaultValue, ulong delta, ulong cas) |
145 | 146 | { |
146 | | - throw new NotImplementedException(); |
| 147 | + return new CasResult<ulong>(); |
147 | 148 | } |
148 | 149 |
|
149 | 150 | public ulong Increment(string key, ulong defaultValue, ulong delta, DateTime expiresAt) |
150 | 151 | { |
151 | | - throw new NotImplementedException(); |
| 152 | + return default(ulong); |
152 | 153 | } |
153 | 154 |
|
154 | 155 | public CasResult<ulong> Increment(string key, ulong defaultValue, ulong delta, TimeSpan validFor, ulong cas) |
155 | 156 | { |
156 | | - throw new NotImplementedException(); |
| 157 | + return new CasResult<ulong>(); |
157 | 158 | } |
158 | 159 |
|
159 | 160 | public CasResult<ulong> Increment(string key, ulong defaultValue, ulong delta, DateTime expiresAt, ulong cas) |
160 | 161 | { |
161 | | - throw new NotImplementedException(); |
| 162 | + return new CasResult<ulong>(); |
162 | 163 | } |
163 | 164 |
|
164 | 165 | public bool Prepend(string key, ArraySegment<byte> data) |
165 | 166 | { |
166 | | - throw new NotImplementedException(); |
| 167 | + return false; |
167 | 168 | } |
168 | 169 |
|
169 | 170 | public CasResult<bool> Prepend(string key, ulong cas, ArraySegment<byte> data) |
170 | 171 | { |
171 | | - throw new NotImplementedException(); |
| 172 | + return new CasResult<bool>(); |
172 | 173 | } |
173 | 174 |
|
174 | 175 | public bool Remove(string key) |
175 | 176 | { |
176 | 177 | return true; |
177 | 178 | } |
178 | 179 |
|
179 | | - public async Task<bool> RemoveAsync(string key) |
| 180 | + public Task<bool> RemoveAsync(string key) |
180 | 181 | { |
181 | | - return true; |
| 182 | + return Task.FromResult<bool>(false); |
182 | 183 | } |
183 | 184 |
|
184 | 185 | public ServerStats Stats() |
185 | 186 | { |
186 | | - throw new NotImplementedException(); |
| 187 | + return new ServerStats(new Dictionary<EndPoint, Dictionary<string, string>>()); |
187 | 188 | } |
188 | 189 |
|
189 | 190 | public ServerStats Stats(string type) |
@@ -218,20 +219,33 @@ public bool Store(StoreMode mode, string key, object value, DateTime expiresAt) |
218 | 219 |
|
219 | 220 | public bool TryGet(string key, out object value) |
220 | 221 | { |
221 | | - throw new NotImplementedException(); |
| 222 | + value = null; |
| 223 | + return false; |
222 | 224 | } |
223 | 225 |
|
224 | 226 | public bool TryGetWithCas(string key, out CasResult<object> value) |
225 | 227 | { |
226 | | - throw new NotImplementedException(); |
| 228 | + value = new CasResult<object>(); |
| 229 | + return false; |
227 | 230 | } |
228 | 231 |
|
229 | 232 | public void Add(string key, object value, int cacheSeconds) |
230 | 233 | { |
231 | 234 | } |
232 | 235 |
|
233 | | - public async Task AddAsync(string key, object value, int cacheSeconds) |
| 236 | + public Task AddAsync(string key, object value, int cacheSeconds) |
| 237 | + { |
| 238 | + return Task.CompletedTask; |
| 239 | + } |
| 240 | + |
| 241 | + public void Set(string key, object value, int cacheSeconds) |
| 242 | + { |
| 243 | + |
| 244 | + } |
| 245 | + |
| 246 | + public Task SetAsync(string key, object value, int cacheSeconds) |
234 | 247 | { |
| 248 | + return Task.CompletedTask; |
235 | 249 | } |
236 | 250 | } |
237 | 251 | } |
0 commit comments