摘要: 传递实体对象,首先定义负责对象 public class Student { public string name { get; set; } public string sex { get; set; } public string age { get; set; } public Adress 阅读全文
posted @ 2021-11-01 17:23 zq爱生活爱代码 阅读(430) 评论(0) 推荐(0) 编辑
摘要: [HttpPost] // POST: api/EasyModelByRequestUrl public string Post(dynamic student) { return $"Post请求 姓名{student.name},性别{student.sex},年龄{student.age}"; 阅读全文
posted @ 2021-11-01 16:28 zq爱生活爱代码 阅读(208) 评论(0) 推荐(0) 编辑
摘要: action public class EasyModelByRequestUrlController : ApiController { // GET: api/EasyModelByRequestUrl [HttpGet] public string Action1(string name,st 阅读全文
posted @ 2021-11-01 14:39 zq爱生活爱代码 阅读(151) 评论(0) 推荐(0) 编辑
摘要: 命名空间System.Net,WebClient是一种更高级别的抽象,是HttpWebRequest为了简化最常见任务而创建的,使用过程中你会发现他缺少基本的header,timeoust的设置,不过这些可以通过继承httpwebrequest来实现。相对来说,WebClient比WebReques 阅读全文
posted @ 2021-11-01 10:12 zq爱生活爱代码 阅读(210) 评论(0) 推荐(0) 编辑
摘要: //利用反射实现深拷贝 public static T DeepCopyByReflection<T>(this T tSource) { T tResult = Activator.CreateInstance<T>(); Type sourceType = typeof(T); Type res 阅读全文
posted @ 2021-11-01 08:55 zq爱生活爱代码 阅读(139) 评论(0) 推荐(0) 编辑