摘要: 当测试环境、生产环境不能够调试的时候,有的时候想通过一些参数跟踪出想要的数据。如:SOA,DALSQL 等。 public class DebugJsonResult: JsonResult { public DebugJsonResult(object Data) ... 阅读全文
posted @ 2015-06-04 13:27 kfsmqoo 阅读(308) 评论(0) 推荐(0) 编辑
摘要: 防止“” 属性变成 null 参数传入时发现对象的属性变成空了,如下图 [HttpPost] public JsonResult CreateOrder(O_CreateOrder obj) { IOrde... 阅读全文
posted @ 2015-06-04 13:03 kfsmqoo 阅读(979) 评论(0) 推荐(0) 编辑
摘要: 应用层:Application 领域层:Domain Model Layer 为什么要用Mapper,随着技术的变化应用层的DTO会发生变化。大的业务契约不能够保证代码上线一次就成功。需要更换契约,SOA1->SOA2。契约中的长名称变成了短名称。由User... 阅读全文
posted @ 2015-05-15 11:56 kfsmqoo 阅读(353) 评论(0) 推荐(0) 编辑
摘要: 正南正北,只要相加经纬度就可以了。 图中发现房子是斜的,28°之后房子正了。 为了计算下个窗户的经纬度,从远方看出去的位置,已知角度28°,斜边移动3.4米。 b=cos(28)*34 b=30.0202181572035160290... 阅读全文
posted @ 2015-04-08 13:54 kfsmqoo 阅读(1431) 评论(0) 推荐(0) 编辑
摘要: 项目中 Business层,大多数代码都是public static fun(string xx) 这样的代码,没有接口。AOP 对象都是依赖于接口的,对于这种无接口的类有没有办法AOP。 答案有肯定的。可以用PostSharp。 AOP 依赖接口的我称之为动态AOP,编译时(MSI... 阅读全文
posted @ 2015-02-11 14:18 kfsmqoo 阅读(1954) 评论(0) 推荐(0) 编辑
摘要: PetShop 部分代码,可以看到每个函数都需要追加HttpRuntime.Cache.Add,都需要在函数体内进行操作。这样子也搞不清楚哪些函数追加了缓存。项目一大就不好控制public static IList GetCategories() { Category cat = new C... 阅读全文
posted @ 2015-01-22 17:49 kfsmqoo 阅读(775) 评论(0) 推荐(0) 编辑
摘要: 引用 dll Microsoft.Practices.Unity.dll Autofac.dll IContainer 接口using System;using System.Collections.Generic;using System.Lin... 阅读全文
posted @ 2015-01-22 15:09 kfsmqoo 阅读(217) 评论(0) 推荐(0) 编辑
摘要: public class Logic { private static readonly double eps = 1e-10; public static Point FindFermat(List poly, double step = 10) { if (poly == null || poly.Count == 0) return nul... 阅读全文
posted @ 2014-12-30 16:00 kfsmqoo 阅读(358) 评论(0) 推荐(0) 编辑
摘要: 比较坑的ko.applyBindings 第二个参数(可选) 可以声明成使用data-bind的HTML元素或者容器。例如, ko.applyBindings(myViewModel, document.getElementById('someElementId'))。它的现... 阅读全文
posted @ 2014-09-26 17:42 kfsmqoo 阅读(640) 评论(0) 推荐(0) 编辑
摘要: 需要引用如下: IDependencyResolver->System.Web.Mvc.dll IUnityContainer->Microsoft.Practices.Unity.dll Global.asax 追加如下方法 protected void ... 阅读全文
posted @ 2014-09-26 16:10 kfsmqoo 阅读(326) 评论(0) 推荐(0) 编辑