public void Setup() { _container = CifParserIocContainerBuilder.Build(); _enumPropertyParsers = _container.Resolve <IRecordEnumPropertyParser[]>(); _dateTimeParser = _container.Resolve <IDateTimeParser>(); }
static void Main(string[] args) { var loggingSettings = new NameValueCollection { ["configType"] = "FILE", ["configFile"] = "NLog.config" }; LogManager.Adapter = new NLogLoggerFactoryAdapter(loggingSettings); Logger = LogManager.GetLogger("NetworkRail.ScheduleParser.Console"); if (Logger.IsInfoEnabled) { Logger.Info("Starting up..."); } const string url = "https://datafeeds.networkrail.co.uk/ntrod/CifFileAuthenticate?type=CIF_ALL_UPDATE_DAILY&day=toc-update-thu.CIF.gz"; var container = CifParserIocContainerBuilder.Build(); if (Logger.IsInfoEnabled) { Logger.Info("Dependency Injection container built."); } var scheduleManager = container.Resolve <IScheduleManager>(); var entites = scheduleManager.GetRecordsByScheduleFileUrl(url).ToList(); entites = scheduleManager.MergeScheduleRecords(entites).ToList(); scheduleManager.SaveScheduleRecords(entites); Console.WriteLine("Press any key to close..."); Console.ReadLine(); }
public void Setup() { _container = CifParserIocContainerBuilder.Build(); _enumPropertyParsers = _container.Resolve <IRecordEnumPropertyParser[]>(); _timingAllowanceParser = _container.Resolve <ITimingAllowanceParser>(); }