static ProductsController()

in DotNETCore/Controllers/ProductsController.cs [22:40]


        static ProductsController()
        {
           
            LazyDdbClient = new Lazy<AmazonDynamoDBClient>(() =>
            {
                var client = new AmazonDynamoDBClient(EC2InstanceMetadata.Region ?? RegionEndpoint.USWest2);

                //var client = new AmazonDynamoDBClient(RegionEndpoint.USWest2); // When running locally, configure with desired region and comment above line of client creation.

                return client;
            });

            LazyTable = new Lazy<Table>(() =>
            {
                var tableName = "SampleProduct";
                return Table.LoadTable(LazyDdbClient.Value, tableName);
            });

        }