Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor. This constructor is used by Lambda to construct the instance. When invoked in a Lambda environment
        /// the AWS credentials will come from the IAM role associated with the function and the AWS region will be set to the
        /// region the Lambda function is executed in.
        /// </summary>
        public ForroLevelLambda()
        {
            var forroAppConfig = new ForroAppConfig
            {
                AWSForroBucketName    = Environment.GetEnvironmentVariable("AWSForroBucketName"),
                AWSRegionEndpoint     = Environment.GetEnvironmentVariable("AWSRegionEndpoint"),
                ForroLevelSNSTopicArn = Environment.GetEnvironmentVariable("ForroLevelSNSTopicArn")
            };

            //Create Dependency Injection Container. Ideally I would use AutoFac, but this for now meets my expectations.
            _serviceCollection = new ServiceCollection();

            //_serviceCollection.
            var forroDependencyInjectionService = new ForroDependencyInjectionService(forroAppConfig);

            forroDependencyInjectionService.DeclareDependencies(_serviceCollection);

            var serviceProvider = _serviceCollection.BuildServiceProvider();

            _forroLevelService = serviceProvider.GetService <IForroLevelService>();
        }
Ejemplo n.º 2
0
 public ForroLevelController(IForroLevelService forroLevelService)
 {
     _forroLevelService = forroLevelService;
 }