01 2016 档案
摘要:internal class ParameterReplacer : ExpressionVisitor { public ParameterReplacer(ParameterExpression paramExpr) { this.Para...
阅读全文
摘要:class WX_Service{private readonly WinnerService _winnerService = new WinnerService();...}这种方式不符合设计模式思路,耦合太厉害,而且没有用到就开始占用实例了改进为 类工厂方法class WX_Service{W...
阅读全文
摘要:只要没有用到 this.变量/方法 的,都可以用static原代码: private string GetPeriodDesc(int lotteryPeriod) { return EnumHelper.GetEnumDesc(EnumHelperEx.ToEnum...
阅读全文
摘要:返回单一值是良好的编程习惯原代码: public LotteryViewModel ValidateLottery(LotteryBaseData baseData, int authTime, out GetDataForValidateLotteryResultModel data) ...
阅读全文
摘要:原代码private string GetExDesc(string lotteryCode) { string exDesc = "抽奖"; if (lotteryCode.ToLower() == "zajindan") ...
阅读全文
摘要:最近对一个同事的代码进行重构第1步对参数中有 bool值的拆分原代码如下: private bool CheckIsInFreeTimes(GetDataForValidateLotteryResultModel data, bool isHelp) { bool i...
阅读全文