- 博客(5)
- 收藏
- 关注
转载 脱离IIS的WebAPI
创建控制台工程 创建纯净版webApi程序(前面的博客有提到) webAPI中引入nuget包 a)Microsoft.AspNet.WebApi.OwinSelfHost b)Microsoft.AspNet.WebApi.WebHost webAPI中新增启动类 1 using Microsoft.Owin; 2 using Owin; ...
2019-01-30 10:46:00
472
转载 WebAPI纯净版中增加Swagger
WebAPI纯净版的基础上 添加nuget包 a). Swashbuckle b). Swagger.Net.UI 取消文件SwaggerConfig.cs中c.IncludeXmlComments(GetXmlCommentsPath());的注释 并在此类中添加方法:GetXmlCommentsPath() 1 private stat...
2019-01-29 11:09:00
148
转载 WebAPI纯净版教程
新建webAPI工程,并删除已经安装的nuget包 添加nuget包 a). Microsoft.AspNet.WebApi.Core b).Microsoft.AspNet.WebApi.WebHost 添加控制器 编写测试方法 1 [HttpGet] 2 public string Hello() 3 { 4 ...
2019-01-29 11:03:00
182
转载 WebAPI教程
新建WebAPI空工程 选择模板 升级nuget包 添加控制器 添加测试方法 1 [HttpGet] 2 public string Hello() 3 { 4 return "hello,world"; 5 } 使用浏览器...
2019-01-29 10:10:00
723
转载 C#通过特性验证实体属性值
一,什么是特性 特性也是一种对象,特殊之处在于其编译时就存在了,也就是在程序运行之前就存在了。 二,如何定义一个特性 [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] public sealed class RequiredAttribute:Attribute { ...
2019-01-10 14:52:00
558
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人