Exemple #1
0
        public async Task InitializeMembershipTable(GlobalConfiguration globalConfiguration, bool tryInitTableVersion, Logger logger)
        {
            this.logger         = logger;
            this.deploymentId   = FirebaseClient.ToCamelCase(string.IsNullOrEmpty(globalConfiguration.DeploymentId) ? "Default" : globalConfiguration.DeploymentId);
            this.firebaseClient = new FirebaseClient();
            this.logger.Info("Initializing Firebase Membership Table");
            var connectionString = globalConfiguration.DataConnectionString.Split("|".ToCharArray());

            this.firebaseClient.BasePath = connectionString[0];
            if (connectionString.Length > 1)
            {
                this.firebaseClient.Key = FirebaseServiceKey.FromBase64(connectionString[1]);
            }

            await this.firebaseClient.Initialize();
        }
        public async Task Init(string name, IProviderRuntime providerRuntime, IProviderConfiguration config)
        {
            var props = config.Properties;

            this.firebaseClient = new FirebaseClient();
            if (props.ContainsKey("Key"))
            {
                this.firebaseClient.Key = FirebaseServiceKey.FromBase64(props["Key"]);
            }

            this.firebaseClient.BasePath = props["BasePath"];
            this.customPaths             = props.ContainsKey("CustomPaths")
                ? props["CustomPaths"].Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries)
                                           .Select(entry => entry.Split('='))
                                           .ToDictionary(split => split[0], split => split[1])
                : new Dictionary <string, string>();

            await this.firebaseClient.Initialize();
        }