Example #1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     ConteinerDependencias.RegistroServicos(services);
     services.AddControllers();
     services.AddSwaggerGen(c =>
     {
         c.SwaggerDoc("v1", new OpenApiInfo {
             Title = "API", Version = "v1"
         });
     });
 }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddControllersWithViews();

            ConteinerDependencias.RegistroServicos(services);

            services.AddAuthentication("loginRecipes")
            .AddCookie("loginRecipes", o => {
                o.LoginPath        = "/Acesso/index";
                o.AccessDeniedPath = "/Acesso/denied";
            });

            //var connection = @"Server=localhost;Database=RecipesWeb;Trusted_Connection=True;ConnectRetryCount=0";
            //var connection = @"Server=(localdb)\MSSQLLocalDB;Database=RecipesWeb;Integrated Security=SSPI;";
            //services.AddDbContext<DatabaseContext>(option => option.UseSqlServer(connection));
        }