代码重构-3 用Tuple代替 out与ref

返回单一值是良好的编程习惯

原代码:

public LotteryViewModel ValidateLottery(LotteryBaseData baseData, int authTime, out GetDataForValidateLotteryResultModel data)
{

....

}

重构后代码:

 public Tuple<LotteryViewModel, GetDataForValidateLotteryResultModel> ValidateLottery(LotteryBaseData baseData, Lottery_AuthTimeEnum authTime )

{

...

}

你可能感兴趣的:(代码重构-3 用Tuple代替 out与ref)