Beispiel #1
0
        }                                        //->https://docs.microsoft.com/en-us/aspnet/core/fundamentals/configuration/?view=aspnetcore-2.2

        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            ServicesDependencyMapper.RegisterDependencies(services, Configuration);

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
        }
Beispiel #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });

            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);
            services = ServicesDependencyMapper.GetDependencies(services, Configuration);
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            var services = ServicesDependencyMapper.GetDependencies(GetConfiguration()).BuildServiceProvider();

            using (var scope = services.CreateScope())
            {
                var eventService    = scope.ServiceProvider.GetService <IEventService>();
                var locationService = scope.ServiceProvider.GetService <ILocationService>();

                //locationService.DeleteLocationById(1110);
                foreach (var item in eventService.GetEvents())
                {
                    System.Console.WriteLine(item.Name);
                }

                //foreach (var item in locationService.GetLocations())
                //{
                //    System.Console.WriteLine(item.Name);
                //}
            }
        }
Beispiel #4
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.Configure <CookiePolicyOptions>(options =>
            {
                // This lambda determines whether user consent for non-essential cookies is needed for a given request.
                options.CheckConsentNeeded    = context => true;
                options.MinimumSameSitePolicy = SameSiteMode.None;
            });


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
            services.AddIdentityCore <UserDTO>(options => { });
            services = ServicesDependencyMapper.GetDependencies(services, Configuration);
            services.AddAuthentication("cookies").AddCookie("cookies", options => options.LoginPath = "/Account/SignIn");
            services.AddAuthorization(options =>
            {
                options.AddPolicy("AdminOnly", policy => policy.RequireClaim("HasAdminRights"));
            });

            services.AddSignalR();
        }
Beispiel #5
0
 // This method gets called by the runtime. Use this method to add services to the container.
 // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddMvc();
     ServicesDependencyMapper.RegisterDependencies(services);
 }