@@ -51,6 +51,11 @@ public CachedTopicRepository(ITopicRepository dataProvider) : base() {
5151 \-----------------------------------------------------------------------------------------------------------------------*/
5252 _dataProvider = dataProvider ;
5353
54+ /*------------------------------------------------------------------------------------------------------------------------
55+ | Ensure topics are loaded
56+ \-----------------------------------------------------------------------------------------------------------------------*/
57+ _cache = _dataProvider . Load ( ) ;
58+
5459 }
5560
5661 /*==========================================================================================================================
@@ -72,13 +77,6 @@ public CachedTopicRepository(ITopicRepository dataProvider) : base() {
7277 /// <returns>A topic object.</returns>
7378 public override Topic Load ( int topicId , bool isRecursive = true ) {
7479
75- /*------------------------------------------------------------------------------------------------------------------------
76- | Ensure topics are loaded
77- \-----------------------------------------------------------------------------------------------------------------------*/
78- if ( _cache == null ) {
79- _cache = _dataProvider . Load ( ) ;
80- }
81-
8280 /*------------------------------------------------------------------------------------------------------------------------
8381 | Handle request for entire tree
8482 \-----------------------------------------------------------------------------------------------------------------------*/
@@ -101,13 +99,6 @@ public override Topic Load(int topicId, bool isRecursive = true) {
10199 /// <returns>A topic object.</returns>
102100 public override Topic Load ( string topicKey = null , bool isRecursive = true ) {
103101
104- /*------------------------------------------------------------------------------------------------------------------------
105- | Ensure topics are loaded
106- \-----------------------------------------------------------------------------------------------------------------------*/
107- if ( _cache == null ) {
108- _cache = _dataProvider . Load ( ) ;
109- }
110-
111102 /*------------------------------------------------------------------------------------------------------------------------
112103 | Lookup by TopicKey
113104 \-----------------------------------------------------------------------------------------------------------------------*/
@@ -218,8 +209,8 @@ private Topic GetTopic(Topic sourceTopic, string uniqueKey) {
218209 /// <param name="isDraft">Boolean indicator as to the topic's publishing status.</param>
219210 /// <returns>The integer return value from the execution of the <c>topics_UpdateTopic</c> stored procedure.</returns>
220211 /// <exception cref="Exception">
221- /// The Content Type <c>topic.Attributes.GetValue(ContentType, Page)</c> referenced by <c>topic.Key</c> could not be found under
222- /// Configuration:ContentTypes. There are <c>TopicRepository.ContentTypes.Count</c> ContentTypes in the Repository.
212+ /// The Content Type <c>topic.Attributes.GetValue(ContentType, Page)</c> referenced by <c>topic.Key</c> could not be found
213+ /// under Configuration:ContentTypes. There are <c>TopicRepository.ContentTypes.Count</c> ContentTypes in the Repository.
223214 /// </exception>
224215 /// <exception cref="Exception">
225216 /// Failed to save Topic <c>topic.Key</c> (<c>topic.Id</c>) via
0 commit comments