Пример #1
0
        public static CalendarsFromJson Parse(string jsonString)
        {
            var returnValue = new CalendarsFromJson()
            {
                _loadedCalendars = JsonConvert.DeserializeObject <Dictionary <string, Calendar> >(jsonString, _jsonSettings)
            };

            returnValue._calendarCollection = new CalendarCollection(returnValue._loadedCalendars.Values);
            return(returnValue);
        }
Пример #2
0
 public static IServiceCollection AddCalendarsFromJson(this IServiceCollection serviceCollection, string fileName) => serviceCollection.AddSingleton <ICalendarProvider>(CalendarsFromJson.Load(fileName));