예제 #1
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public Task <ExportableCI> ExportAsync()
        {
            var exportable = new ExportableSportCI
            {
                Id               = Id.ToString(),
                Name             = new Dictionary <CultureInfo, string>(Name),
                CategoryIds      = CategoryIds?.Select(id => id.ToString()).ToList(),
                LoadedCategories = new List <CultureInfo>(_loadedCategories)
            };

            return(Task.FromResult <ExportableCI>(exportable));
        }
예제 #2
0
        /// <summary>
        /// Asynchronous export item's properties
        /// </summary>
        /// <returns>An <see cref="ExportableCI"/> instance containing all relevant properties</returns>
        public Task <ExportableCI> ExportAsync()
        {
            var exportable = new ExportableSportCI
            {
                Id               = Id.ToString(),
                Name             = new ReadOnlyDictionary <CultureInfo, string>(Name),
                CategoryIds      = CategoryIds != null ? new ReadOnlyCollection <string>(CategoryIds.Select(id => id.ToString()).ToList()) : null,
                LoadedCategories = new ReadOnlyCollection <CultureInfo>(_loadedCategories)
            };

            return(Task.FromResult <ExportableCI>(exportable));
        }
예제 #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="SportCI"/> class.
 /// </summary>
 /// <param name="exportable">A <see cref="ExportableSportCI" /> representing the cache item</param>
 public SportCI(ExportableSportCI exportable)
     : base(exportable)
 {
     CategoryIds       = exportable.CategoryIds != null ? new ReadOnlyCollection <URN>(exportable.CategoryIds.Select(URN.Parse).ToList()) : null;
     _loadedCategories = exportable.LoadedCategories != null ? new List <CultureInfo>(exportable.LoadedCategories) : new List <CultureInfo>();
 }