示例#1
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, IServiceProvider serviceProvider, IConfiguration configuration)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            CreateRole.Create(serviceProvider, configuration);
        }
示例#2
0
        public ActionResult Create([Bind(Prefix = "Item")] CreateRole item)
        {
            IMessageProvider msg = null;

            if (ModelState.IsValid(item))
            {
                this.ModelState.Clear();
                msg  = item.Create();
                item = _container.Resolve <CreateRole>();
            }
            item.Ready();
            return(View(new EcardModelItem <CreateRole>(item, msg)));
        }