结构图Program类代码
public class Program
{public static void Main(string[] args){CreateHostBuilder(args).Build().Run();}public static IHostBuilder CreateHostBuilder(string[] args) =>Host.CreateDefaultBuilder(args).ConfigureAppConfiguration(conf =>{conf.Add…
以下是Startup类下的核心代码 这里用的是.net core 2.0 如果更高版本 也差不多稍微改动一点就可以
public void ConfigureServices(IServiceCollection services)
{services.AddMvc();
}// This method gets called by the runtime. Use this method to configure the HTTP req…
using Microsoft.Extensions.Caching.Memory;
using System;namespace lqwvje.Common
{public class CacheHelper{ //原创来自 http://www.luofenming.com/show.aspx?id=ART2019101900001public static IMemoryCache _memoryCache = new MemoryCache(new MemoryCacheOptions…