コード例 #1
0
ファイル: Startup.cs プロジェクト: jiraspiom/VendasWebMvc
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, IHostingEnvironment env, PopularBase popularBase)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
                popularBase.Popular();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
                app.UseHsts();
            }

            app.UseHttpsRedirection();
            app.UseStaticFiles();
            app.UseCookiePolicy();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
        }
コード例 #2
0
 /// <inheritdoc />
 public override void Write(Utf8JsonWriter writer, ContentType value, JsonSerializerOptions options)
 {
     writer.WriteStringValue(PopularBase.GetPopularTypeString(value));
 }
コード例 #3
0
 /// <inheritdoc />
 public override ContentType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options)
 {
     return(PopularBase.GetPopularType(reader.GetString()));
 }