Example #1
0
        public Startup(IConfiguration configuration, IHostingEnvironment env)
        {
            Configuration = configuration;

            if (env.IsDevelopment())
            {
                this.developmentEnvironment = true;
            }

            identityStartup = new IdentityStartup(configuration, this.developmentEnvironment);
            dataStartup     = new DataStartup();
            apiStartup      = new ApiStartup();
            servicesStartup = new ServicesStartup();
        }
        public static void ConfigureServices(IServiceCollection services)
        {
            DataStartup.ConfigureServices(services, "Server=(localdb)\\MSSQLLocalDB;Database=AutoService;Integrated Security=true;");

            services.AddTransient <IUserManager, UserManager>(sp => new UserManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <IAddressManager, AddressManager>(sp => new AddressManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <IClientManager, ClientManager>(sp => new ClientManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <IDriverLicenseManager, DriverLicenseManager>(sp => new DriverLicenseManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <IFuelManager, FuelManager>(sp => new FuelManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <IInspectionManager, InspectionManager>(sp => new InspectionManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <ITransportCategoryManager, TransportCategoryManager>(sp => new TransportCategoryManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <ITransportMakeManager, TransportMakeManager>(sp => new TransportMakeManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <ITransportManager, TransportManager>(sp => new TransportManager(sp.GetService <DatabaseContext>()));
            services.AddTransient <ITransportModelManager, TransportModelManager>(sp => new TransportModelManager(sp.GetService <DatabaseContext>()));
        }
Example #3
0
        public void Init(IConfiguration configuration, IWebHostEnvironment env)
        {
            this.Configuration      = configuration;
            this.CurrentEnvironment = env;

            if (env.IsDevelopment())
            {
                this.developmentEnvironment = true;
            }

            identityStartup = new IdentityStartup(configuration, this.developmentEnvironment);
            dataStartup     = new DataStartup();
            apiStartup      = new ApiStartup();
            servicesStartup = new ServicesStartup();
        }
Example #4
0
    // IMPLEMENTATION METHODS

    private void Init()
    {
        // instantiate datastores
        this.assetData          = new AssetData();
        this.kittyData          = new KittyData();
        this.accessoryData      = new AccessoryData();
        this.kittyAccessoryData = new KittyAccessoryData();
        this.mazeProgressData   = new MazeProgressData();
        // execute data startup processes
        this.dataStartup = new DataStartup();
        this.dataStartup.ExecuteStartupProcesses();
        // instantiate unity events object
        this.unityEvents = new UnityEvents();
        // instantiate admin control object
        this.adminControl = new AdminControl();
    }
Example #5
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            services.AddSwaggerGen(c =>
            {
                c.SwaggerDoc("tarefas", new Microsoft.OpenApi.Models.OpenApiInfo
                {
                    Version = "1.0",
                    Title   = "Projeto Tarefas"
                });
            });

            DataStartup.AddConnectionStringContext(services, Configuration);

            BusinessStartup.AddServices(services);
        }
Example #6
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvcCore()
            .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
            .AddApiExplorer();

            services.AddMvc();

            DataStartup.ConfigureServices(services, Configuration);

            services.AddSwaggerGen(c => { c.SwaggerDoc("v1", new Info {
                    Title = "APIAgenda", Version = "v1"
                }); });
            services.AddCors(c =>
            {
                c.AddPolicy("AllowOrigin", options => options.AllowAnyOrigin());
            });
            services.AddCors(c =>
            {
                c.AddPolicy("AllowOrigin", options => options.WithOrigins("https://localhost:5000/api/Pessoa"));
            });
        }