Commit a9ea634
committed
Update
While many updates to the configuration metadata are made available in real time, some—such as adding or deleting `ContentTypeDescriptor`s—are not. This is because the `TopicRepositoryBase.GetContentTypeDecriptors()` method caches the list of content types so that it doesn't need to reload it from the persistence store each time its called.
To mitigate this, we can dynamically update the `GetContentTypeDescriptors()` cache when we call `Save()` or `Delete()`. Specifically, if `Save()` is called with a `ContentTypeDescriptor` and that content type is new, then it will be added to the local `_contentTypeDescriptors` collection. Similarly, if `Delete()` is called with a `ContentTypeDescriptor` then that content type—along with all descendent content types—will be removed from the _contentTypeDescriptors` collection.
This satisfies the requirements of the newly proposed feature enhancement: Update content type cache when adding or removing content types (#16).GetContentTypeDescriptors() cache on Save(), Delete()
1 parent 408d01a commit a9ea634
2 files changed
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
200 | 200 | | |
201 | 201 | | |
202 | 202 | | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
203 | 243 | | |
204 | 244 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
318 | 330 | | |
319 | 331 | | |
320 | 332 | | |
| |||
403 | 415 | | |
404 | 416 | | |
405 | 417 | | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
406 | 429 | | |
407 | 430 | | |
408 | 431 | | |
| |||
0 commit comments