Beispiel #1
0
        private static int OnParse(GlobalOptions globals, object parsedOpts)
        {
            var opts = SmiCliInit.Verify <IsIdentifiableAbstractOptions>(parsedOpts);

            return(opts switch
            {
                IsIdentifiableRelationalDatabaseOptions o => Run(o),
                IsIdentifiableDicomFileOptions o => Run(o),
                IsIdentifiableMongoOptions o => Run(o),
                IsIdentifiableServiceOptions o => Run(o),
                IsIdentifiableFileOptions o => Run(o),
                _ => throw new NotImplementedException($"No case for '{opts.GetType()}'")
            });
Beispiel #2
0
        private static int OnParse(GlobalOptions globals, object opts)
        {
            var parsedOptions = SmiCliInit.Verify <TriggerUpdatesCliOptions>(opts);

            ITriggerUpdatesSource source = parsedOptions switch
            {
                TriggerUpdatesFromMapperOptions o => new MapperSource(globals, o),
                TriggerUpdatesFromMongoOptions o => new MongoSource(globals, o),
                _ => throw new NotImplementedException($"No case for '{parsedOptions.GetType()}'")
            };

            var bootstrapper = new MicroserviceHostBootstrapper(() => new TriggerUpdatesHost(globals, source));
            int ret          = bootstrapper.Main();

            return(ret);
        }
    }