// 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?}"); }); }
/// <inheritdoc /> public override void Write(Utf8JsonWriter writer, ContentType value, JsonSerializerOptions options) { writer.WriteStringValue(PopularBase.GetPopularTypeString(value)); }
/// <inheritdoc /> public override ContentType Read(ref Utf8JsonReader reader, Type typeToConvert, JsonSerializerOptions options) { return(PopularBase.GetPopularType(reader.GetString())); }