public Season RetrieveSeason()
 {
     var sid = SeasonId ?? ApiParentId;
     if (seasonItem == null && !string.IsNullOrEmpty(sid))
     {
         var seasonId = new Guid(sid);
         seasonItem = Kernel.Instance.MB3ApiRepository.RetrieveItem(seasonId) as Season;
     }
     return seasonItem;
 }
Beispiel #2
0
 public Season RetrieveSeason()
 {
     if (seasonItem == null && !string.IsNullOrEmpty(this.Path))
     {
         //derive id of what would be our season - hate this but don't have to store and maintain pointers this way
         string parentPath = System.IO.Path.GetDirectoryName(this.Path);
         Guid seasonId = (typeof(Season).FullName + parentPath.ToLower()).GetMD5();
         seasonItem = Kernel.Instance.ItemRepository.RetrieveItem(seasonId) as Season;
     }
     return seasonItem;
 }
        public Season RetrieveSeason()
        {
            var sid = SeasonId ?? ApiParentId;
            if (seasonItem == null && !string.IsNullOrEmpty(sid))
            {
                lock (SeasonCache)
                {
                    var id = new Guid(sid);
                    seasonItem = SeasonCache.GetValueOrDefault(id, null) ?? Kernel.Instance.MB3ApiRepository.RetrieveItem(id) as Season;
                   SeasonCache[id] = seasonItem;
                }
            }

            return seasonItem;
        }