string.Join()用法


string strTripID = string.Join(",", model.TripList.Select(s => "'" + s.TripID + "'"));   

var togetherList = itogetheremployeeservice.GetTogetherEmployee(strTripID);

    public List<T_TOGETHEREMPLOYEE> GetTogetherEmployee(string bizID)
    {
        var tmpList = Filter(item => bizID.Contains(item.BizID)).ToList();
        return tmpList;
    }




string strTripID = string.Join(",", returnValue.TripList.Select(s => "'" + s.TripID + "'"));
string sqlStr = " select * from T_TOGETHEREMPLOYEE where BizID in (" + strTripID + ") ";
var togetherList = AppBaseServiceHelper.GetList<TOGETHEREMPLOYEEModel>(sqlStr, null);
posted @ 2019-07-26 17:18  无敌土豆  阅读(2974)  评论(0编辑  收藏  举报