/// <summary> /// 转换为佣金数据传输对象 /// </summary> /// <param name="entity">佣金实体</param> public static CommissionDto ToDto(this Commission entity) { if (entity == null) { return(new CommissionDto()); } var result = entity.MapTo <CommissionDto>(); result.AgentName = entity.Agent.Name; result.OrderOutId = entity.Order.OrderOutId; return(result); }