当前位置: 首页>>代码示例>>C#>>正文


C# IServiceCollection.AddReact方法代码示例

本文整理汇总了C#中IServiceCollection.AddReact方法的典型用法代码示例。如果您正苦于以下问题:C# IServiceCollection.AddReact方法的具体用法?C# IServiceCollection.AddReact怎么用?C# IServiceCollection.AddReact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IServiceCollection的用法示例。


在下文中一共展示了IServiceCollection.AddReact方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
			services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
			services.AddReact();
            // Add framework services.
            services.AddMvc();
        }
开发者ID:reactjs,项目名称:React.NET,代码行数:8,代码来源:Startup.cs

示例2: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add Entity Framework services to the services container.
            services.AddEntityFramework()
                .AddSqlServer()
                .AddDbContext<ApplicationDbContext>(options =>
                    options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));

            // Add Identity services to the services container.
            services.AddIdentity<ApplicationUser, IdentityRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>()
                .AddDefaultTokenProviders();

            services.AddReact();

            // Add MVC services to the services container.
            services.AddMvc();

            // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers.
            // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json.
            // services.AddWebApiConventions();

            // Register application services.
            services.AddTransient<IEmailSender, AuthMessageSender>();
            services.AddTransient<ISmsSender, AuthMessageSender>();
        }
开发者ID:calebjenkins,项目名称:presentations,代码行数:27,代码来源:Startup.cs

示例3: ConfigureServices

		// This method gets called by the runtime.
		public void ConfigureServices(IServiceCollection services)
		{
			// Add MVC services to the services container.
			services.AddMvc();

			// Add ReactJS.NET services.
			services.AddReact();
		}
开发者ID:joekrie,项目名称:React.NET,代码行数:9,代码来源:Startup.cs

示例4: ConfigureServices

		// This method gets called by the runtime.
		public void ConfigureServices(IServiceCollection services)
		{
			// Add MVC services to the services container.
			services.AddMvc();
            services.AddMemoryCache();
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
			// Add ReactJS.NET services.
			services.AddReact();
		}
开发者ID:RichardD012,项目名称:React.NET,代码行数:10,代码来源:Startup.cs

示例5: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddReact();

            // to work with SignalR in RC1 you have to include in your nuget sources this one: 
            //https://www.myget.org/F/aspnetmaster/api/v3/index.json
            services.AddSignalR();

            services.AddMvc();

        }
开发者ID:cronycles,项目名称:react_tutorial,代码行数:12,代码来源:Startup.cs

示例6: ConfigureServices

        // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc((option)=> {
                var jsonOutput= option.OutputFormatters.OfType<JsonOutputFormatter>().Single();
                jsonOutput.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();

                var jsonInputs = option.InputFormatters.OfType<JsonInputFormatter>().ToArray();
                foreach (var json in jsonInputs)
                {
                    json.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver();
                }
            });
            services.AddReact();
        }
开发者ID:scfido,项目名称:ReactDemo,代码行数:15,代码来源:Startup.cs

示例7: ConfigureServices

		// This method gets called by the runtime. Use this method to add services to the container.
		public void ConfigureServices(IServiceCollection services)
		{
			// Add framework services.
			services.AddApplicationInsightsTelemetry(Configuration);

			services.AddEntityFramework()
			    .AddSqlServer()
			    .AddDbContext<BookNoteContext>();

			services.AddIdentity<ApplicationUser, IdentityRole>()
			    .AddEntityFrameworkStores<BookNoteContext>()
			    .AddDefaultTokenProviders();

			services.AddMvc();

			services.AddReact();

			// Add application services.
			services.AddTransient<IEmailSender, AuthMessageSender>();
			services.AddTransient<ISmsSender, AuthMessageSender>();
			services.AddScoped<IBookShelfService, BookShelfService>();

			RegisterRepositories(services);
		}
开发者ID:andreij6,项目名称:booknote,代码行数:25,代码来源:Startup.cs

示例8: ConfigureServices

 // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddMvc();
     services.AddReact();
 }
开发者ID:MacsDickinson,项目名称:ReactForNetDevs,代码行数:6,代码来源:Startup.cs

示例9: ConfigureServices

        // This method gets called by the runtime.
        public void ConfigureServices(IServiceCollection services)
        {
            //ReactServiceCollectionExtensions.AddReact(services);
               services.AddReact();

            // Add MVC services to the services container.
            services.AddMvc();

            // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers.
            // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json.
            // services.AddWebApiConventions();
        }
开发者ID:victorantos,项目名称:off2day,代码行数:13,代码来源:Startup.cs

示例10: ConfigureServices

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddIdentity<SimpleIdentityUser, SimpleIdentityRole>()
                .AddSimpleIdentity<SimpleIdentityUser>(Configuration.GetSection("Auth"))
                .AddDefaultTokenProviders();

            services.AddSession();
            services.AddMvc();
            services.AddReact();
            services.AddDaniel15();
            services.AddDaniel15Config(Configuration);
        }
开发者ID:Daniel15,项目名称:Website,代码行数:12,代码来源:Startup.cs

示例11: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add Entity Framework services to the services container.
            services.AddEntityFramework()
                .AddSqlServer()
                .AddDbContext<ApplicationDbContext>(options =>
                    options.UseSqlServer(Configuration["Data:CRMDBConnection:ConnectionString"]));

            // Add Identity services to the services container.
            services.AddIdentity<ApplicationUser, IdentityRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>();

            services.ConfigureIdentity(conf => {
                conf.Password.RequiredLength = 6;
                conf.Password.RequireLowercase = false;
                conf.Password.RequireDigit = false;
                conf.Password.RequireNonLetterOrDigit = false;
                conf.Password.RequireUppercase = false;

                conf.User.UserNameValidationRegex = null;
            });

            // Configure the options for the authentication middleware.
            // You can add options for Google, Twitter and other middleware as shown below.
            // For more information see http://go.microsoft.com/fwlink/?LinkID=532715
            services.Configure<FacebookAuthenticationOptions>(options =>
            {
                options.AppId = Configuration["Authentication:Facebook:AppId"];
                options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
            });

            services.Configure<MicrosoftAccountAuthenticationOptions>(options =>
            {
                options.ClientId = Configuration["Authentication:MicrosoftAccount:ClientId"];
                options.ClientSecret = Configuration["Authentication:MicrosoftAccount:ClientSecret"];
            });

            services.ConfigureCookieAuthentication(options => {
                CookieAuthenticationNotifications cookieAuthN = options.Notifications as CookieAuthenticationNotifications;
                if (cookieAuthN == null)
                {
                    cookieAuthN = new CookieAuthenticationNotifications();
                    options.Notifications = cookieAuthN;
                }

                cookieAuthN.OnApplyRedirect = ctx =>
                {
                    if (IsAjaxRequest(ctx.Request) == false)
                    {
                        ctx.Response.Redirect(ctx.RedirectUri);
                    }
                };
            });

            // Add MVC services to the services container.
            services.AddMvc();

            // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers.
            // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json.
            // services.AddWebApiConventions();

            // Register application services.
            services.AddTransient<IEmailSender, AuthMessageSender>();
            services.AddTransient<ISmsSender, AuthMessageSender>();

            services.AddReact();
        }
开发者ID:AntonHuang,项目名称:WebApp,代码行数:68,代码来源:Startup.cs

示例12: ConfigureServices

 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     // Add framework services.
     services.AddReact();
     services.AddMvc();
 }
开发者ID:jimfim,项目名称:Asp5React,代码行数:7,代码来源:Startup.cs

示例13: ConfigureServices

        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Add Entity Framework services to the services container.
            services.AddEntityFramework()
                .AddSqlServer()
                .AddDbContext<ApplicationDbContext>(options =>
                    options.UseSqlServer(Configuration["Data:DefaultConnection:ConnectionString"]));

            // Add Identity services to the services container.
            services.AddIdentity<ApplicationUser, IdentityRole>()
                .AddEntityFrameworkStores<ApplicationDbContext>()
                .AddDefaultTokenProviders();

            // Configure the options for the authentication middleware.
            // You can add options for Google, Twitter and other middleware as shown below.
            // For more information see http://go.microsoft.com/fwlink/?LinkID=532715
            services.Configure<FacebookAuthenticationOptions>(options =>
            {
                options.AppId = Configuration["Authentication:Facebook:AppId"];
                options.AppSecret = Configuration["Authentication:Facebook:AppSecret"];
            });

            services.Configure<MicrosoftAccountAuthenticationOptions>(options =>
            {
                options.ClientId = Configuration["Authentication:MicrosoftAccount:ClientId"];
                options.ClientSecret = Configuration["Authentication:MicrosoftAccount:ClientSecret"];
            });

            services.AddReact();

            // Add MVC services to the services container.
            services.AddMvc();

            // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers.
            // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json.
            // services.AddWebApiConventions();

            // Register application services.
            services.AddTransient<IEmailSender, AuthMessageSender>();
            services.AddTransient<ISmsSender, AuthMessageSender>();
        }
开发者ID:jongalloway,项目名称:react-js-net-repro,代码行数:42,代码来源:Startup.cs


注:本文中的IServiceCollection.AddReact方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。