lenmom

博客园 首页 新随笔 联系 订阅 管理
上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 43 下一页

2018年4月11日 #

摘要: 原文地址:http://www.cnblogs.com/fish-li/archive/2011/07/03/2096903.html#undefined Cookie虽然是个很简单的东西,但它又是WEB开发中一个很重要的客户端数据来源,而且它可以实现扩展性很好的会话状态, 所以我认为每个WEB开发 阅读全文
posted @ 2018-04-11 19:54 老董 阅读(703) 评论(0) 推荐(0)

摘要: A benefit of using ASP.NET Web API is that it can be consumed by any client with the capability of making HTTP calls and processing JSON data. The cli 阅读全文
posted @ 2018-04-11 19:07 老董 阅读(343) 评论(0) 推荐(0)

摘要: ASP.NET Web API, as we know now, is a framework that helps build Services over HTTP. Web API was introduced as a lightweight service framework keeping 阅读全文
posted @ 2018-04-11 19:03 老董 阅读(340) 评论(0) 推荐(0)

摘要: In a Web API application, I use Castle Windsor to supply services configured with PerWebRequest lifetime and everything works fine on IIS. However, wh 阅读全文
posted @ 2018-04-11 18:58 老董 阅读(235) 评论(0) 推荐(0)

摘要: 阅读目录 开始 无处不在的HttpContext HttpContext.Current到底保存在哪里? HttpContext并非无处不在! 如何获取文件绝对路径? 异步调用中如何访问HttpContext? 安全地使用HttpContext.Current 阅读目录 开始 无处不在的HttpCo 阅读全文
posted @ 2018-04-11 15:14 老董 阅读(952) 评论(0) 推荐(0)

2018年3月29日 #

摘要: 【原文第一段】 孙子曰:昔之善战者,先为不可胜,以待敌之可胜。不可胜在己,可胜在敌。故善战者,能为不可胜,不能使敌之必可胜。故曰:胜可知,而不可为。 【译文】 孙子说:从前善于打仗的人,总是先创造条件使自己立于不败之地,然后捕捉战机攻胜敌人。做到不可战胜,就会掌握战争的主动权;敌人出现空隙,就乘机击 阅读全文
posted @ 2018-03-29 11:42 老董 阅读(616) 评论(0) 推荐(0)

2018年3月20日 #

摘要: Having said that, here is a solution that you can use with the Unity container: Create some custom attributes for the different lifetime styles that y 阅读全文
posted @ 2018-03-20 17:13 老董 阅读(240) 评论(0) 推荐(0)

摘要: 背景 使用Autofac进行依赖注入时,经常遇到的场景是在容器中进行类似如下代码的注入操作: 因为这种注入是统一进行的,随着项目规模的扩大和代码复杂度的增加,需要在注册的地方不断地增加新的类来注册类型,这样会使代码失去了开闭原则:对修改关闭,对扩展开放。 解决方案 1. 定义一个属性用于标识类的注入 阅读全文
posted @ 2018-03-20 15:15 老董 阅读(409) 评论(0) 推荐(0)

摘要: 1. 通过Nuget安装System.Web.Http.Tracing. 2. 通过HttpConfiguration,注册SystemDiagnosticsTraceWriter 3. 运行,即可看到整个运行过程的信息日志信息,通过日志信息可以窥探WebApi的运行内核信息。 发送请求: 输出信息 阅读全文
posted @ 2018-03-20 10:58 老董 阅读(2291) 评论(0) 推荐(0)

2018年3月19日 #

摘要: 1. nuget添加FluentValidation.WebApi引用. 2. 模型定义: 3. Validator定义: 4. Controller定义: 5. Validation Action Filter定义: 6. 最后在WebApp启动时注册注册ValidationFilter: 7. 阅读全文
posted @ 2018-03-19 14:17 老董 阅读(233) 评论(0) 推荐(0)

上一页 1 ··· 30 31 32 33 34 35 36 37 38 ··· 43 下一页