代码很粗糙~

粘贴github地址

https://github.com/htrlq/MiniAspNetCoreMini

demo

     public class Startup
{
public Startup(IConfiguration configuration)
{
Configuration = configuration;
} public IConfiguration Configuration { get; } // This method gets called by the runtime. Use this method to add services to the container.
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc(); services
.AddApiServerInit()
.AddApiServer<MyController>();
} // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
} app.UseMvc(); app.UseRouter(route =>
{
route.UserApiServer();
});
}
} public enum OrderSort
{
DoExecute,
Success,
NotPay
} public class ParamOrderSort
{
[Required]
public Guid? UserId { get; set; }
[Required]
public OrderSort? Type { get; set; }
public int? PageIndex { get; set; }
public int? PageSize { get; set; }
} public class MyController : ApiServerBase
{
[HttpGet]
[HttpPost]
public async Task Show(ParamOrderSort param)
{
await context.HttpContext.Response.WriteAsync($"{param.UserId} {param.Type} {param.PageIndex} {param.PageSize}");
} public MyController(IHttpContextAccessor context) : base(context)
{
}
}

最新文章

  1. HDU 1281 二分图
  2. 字符串匹配的KMP算法
  3. php课程---面向对象
  4. Silverlight ModelView中调用UI进程
  5. Maven错误在这里看【项目无法成功编译由于maven未成功下载依赖导致】
  6. 1154 能量项链[区间dp]
  7. java反射知识
  8. UITableView的简单应用介绍
  9. Oracle start with connect by prior 用法
  10. Git 版本回退问题详解
  11. swift 定位 根据定位到的经纬度转换城市名
  12. ios开发 第一天
  13. 自己动手写Redis客户端(C#实现)2 - SET请求和状态回复(set)
  14. XML数据读取——Digester简单使用
  15. zc702-自定义AXI-IP核实验
  16. git 远程删除文件
  17. 如何在 sublime text 中以当前文件目录打开 cmd
  18. 『转』credential Provider 简易改写攻略
  19. 启动服务报错:nested exception is java.lang.NoSuchMethodError: org.apache.cxf.common.jaxb.JAXBUtils.closeUnmarshaller(Ljavax/xml/bind/Unmarshaller;)V
  20. BFS和DFS (java版)

热门文章

  1. day07 流程控制
  2. 谈谈你对 TCP 三次握手和四次挥手的理解
  3. python 爬虫由于网络或代理不能用导致的问题处理方法
  4. 数据可视化基础专题(十二):Matplotlib 基础(四)常用图表(二)气泡图、堆叠图、雷达图、饼图、
  5. 机器学习实战基础(十四):sklearn中的数据预处理和特征工程(七)特征选择 之 Filter过滤法(一) 方差过滤
  6. nodejs之数据库连接
  7. redis pipelined 示例
  8. React Native 控制一个component的显示隐藏
  9. element上传功能携带参数
  10. MySQL Front远程连接数据库