Ejemplo n.º 1
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            var result = Deployer.DeployDatabase(Configuration.GetConnectionString("DefaultConnection"));

            if (!result.Successful)
            {
                throw result.Error;
            }

            services.AddControllers().AddNewtonsoftJson();
            services.AddControllersWithViews();

            services.AddScoped(typeof(IDriverRepository), typeof(DriverRepository));
            services.AddScoped(typeof(IDriverService), typeof(DriverService));
        }