Example #1
0
        void Start()
        {
            //Something needs to call DependencyInjection.InjectDependencies.
            //
            //One option is to call it in MonoBehaviour::Start...
            InjectDependencies.On(this);

            GetComponent <Button>().onClick.AddListener(this.OnClick);
        }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            InjectDependencies.Configure(services, _configuration.GetConnectionString("dbConnection").ToString());

            services.AddMvc(config => {
                config.Filters.Add(typeof(CustomExceptionFilter));
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
        }
Example #3
0
        private void Start()
        {
            //Something needs to call DependencyInjection.InjectDependencies.
            //
            //One option is to call it in MonoBehaviour::Start...
            InjectDependencies.On(this);

            m_text = GetComponent <Text>();

            // since dependency injection is complete, the counter property should be set now
            this.counter.onUpdated.AddListener(this.UpdateDisplay);
            UpdateDisplay();
        }
Example #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllers()
            .AddNewtonsoftJson();

            services.AddSwaggerGen(s =>
            {
                s.SwaggerDoc("v1", new OpenApiInfo
                {
                    Version = "v1",
                    Title   = "TravelRouteApi",
                    Contact = new OpenApiContact {
                        Name = "Rodrigo Prandi Araújo", Email = "*****@*****.**"
                    }
                });
            });


            InjectDependencies.RegisterServices(services);
        }