コード例 #1
0
        public static ServiceRegistryService GetLocalServiceRegistryService(DataSettings dataSettings, IApplicationNameProvider appNameProvider, string assemblySearchPattern, ILogger logger = null)
        {
            logger = logger ?? Log.Default;
            DaoRepository             repo        = dataSettings.GetSysDaoRepository(logger, nameof(FileService));
            FileService               fileService = new FileService(repo);
            AssemblyServiceRepository assRepo     = new AssemblyServiceRepository();

            assRepo.Database = dataSettings.GetSysDatabaseFor(assRepo);
            assRepo.EnsureDaoAssemblyAndSchema();
            AssemblyService           assemblyService     = new AssemblyService(DataSettings.Current, fileService, assRepo, appNameProvider);
            ServiceRegistryRepository serviceRegistryRepo = new ServiceRegistryRepository();

            serviceRegistryRepo.Database = dataSettings.GetSysDatabaseFor(serviceRegistryRepo);
            serviceRegistryRepo.EnsureDaoAssemblyAndSchema();
            ServiceRegistryService serviceRegistryService = new ServiceRegistryService(
                fileService,
                assemblyService,
                serviceRegistryRepo,
                dataSettings.GetSysDaoRepository(logger),
                new AppConf {
                Name = appNameProvider.GetApplicationName()
            }
                )
            {
                AssemblySearchPattern = assemblySearchPattern
            };

            return(serviceRegistryService);
        }