public SerializedioRepository(IOptions <SerializedClientFactoryOptions> connectionOptions)
        {
            SerializedClientFactory serializedClientFactory = SerializedClientFactory.Create(options =>
            {
                options.AccessKey       = connectionOptions.Value.AccessKey;
                options.SecretAccessKey = connectionOptions.Value.SecretAccessKey;
                options.BaseUrl         = connectionOptions.Value.BaseUrl;
            });

            _aggregatesClient = serializedClientFactory.CreateAggregatesClient();
        }
Beispiel #2
0
        static async Task Main(string[] args)
        {
            SerializedClientFactory serializedClientFactory = SerializedClientFactory.Create(options =>
            {
                options.BaseUri         = new Uri("https://api.serialized.io/");
                options.AccessKey       = "af022c25705f4d3eb350a17384c32100";
                options.SecretAccessKey = "56dceaa81e0f41bdb76adc7db20a5b3d9ee90a31cee34d39ac938d2054cfa38c";
            });

            _aggregatesClient  = serializedClientFactory.CreateAggregatesClient();
            _projectionsClient = serializedClientFactory.CreateProjectionsClient();

            Console.Write("Run method Read(r), Seed(s), CreateProjection(p), QueryProjection(q): ");
            string method = Console.ReadLine();

            switch (method)
            {
            case "r":
                await ReadAggregate();

                break;

            case "s":
                await Seed();

                break;

            case "p":
                await CreateProjection();

                break;

            case "q":
                await QueryProjection();

                break;

            default:
                Console.WriteLine("Method not found.");
                break;
            }

            Console.ReadKey();
        }