07 2021 档案

摘要:一、路由 API=》App_Start文件夹=》WebApiCongfig 二、特性 局部特性:[Route("")] 全局特性:[RoutePrefix("")] post=>[FromBody] get=>[FromUri] 三、API+MVC强类型添加 引用两个方法 using System. 阅读全文
posted @ 2021-07-29 21:36 疾风回荡寻真途 阅读(27) 评论(0) 推荐(0) 编辑
摘要:一、webapi跨域第二方案 需要在NuGet包当中下载Microsoft.AspNet.WebApi.Cors插件 在WebApiConfig当中 添加 跨域设置 config.EnableCors(new EnableCorsAttribute("","","*")); 将[EnableCors 阅读全文
posted @ 2021-07-28 21:15 疾风回荡寻真途 阅读(51) 评论(0) 推荐(0) 编辑
摘要:一、HTTP协议(超文本传输协议) http 协议 版本 1.1 http 由来 1960年 http通讯 http原理 URL 和 URI 区别 Request 请求报文 Response 响应报文 Http 状态码 常用的 200(成功) 500(服务器端错误) 404(URL路径错误) HTT 阅读全文
posted @ 2021-07-21 09:52 疾风回荡寻真途 阅读(141) 评论(0) 推荐(0) 编辑
摘要:一、MVC+EF 不管是MVC还是EF都有文件夹Controllers 下边的文件必须以Controller 结尾 WEBAPI接口不要使用中文名称 二、Linq查询 多表联查 Linq 查询 使用方法 匿名类型return Json(new { totalcount, totalpage, lis 阅读全文
posted @ 2021-07-20 16:22 疾风回荡寻真途 阅读(242) 评论(0) 推荐(0) 编辑
摘要:一、在Models中创建实体类 1、需要引用 using System.ComponentModel.DataAnnotations;using System.ComponentModel.DataAnnotations.Schema; 2、在类中写下自己需要的字段 1)、主表 /// <summa 阅读全文
posted @ 2021-07-15 21:10 疾风回荡寻真途 阅读(572) 评论(1) 推荐(0) 编辑

点击右上角即可分享
微信分享提示