一些LINQ的使用

var list = from staff in staffList
           from extraRecord in extraList
           where staff.staffID == extraRecord.staffID && staff.staffID != Loginer.staffID
           && extraRecord.depOpinion == null
           select extraRecord;


private IList<Model.ExtraInfo> mySort(IList<Model.ExtraInfo> list)
        {
            var tempList = from tp in list orderby tp.applyTime descending select tp;
            IList<TYKY_OA.Model.ExtraInfo> applyList = new List<TYKY_OA.Model.ExtraInfo>();
            foreach (var item in tempList)
            {
                applyList.Add(item);
            }
            return applyList;

        }

 

posted @ 2014-01-27 17:06  aswater  阅读(198)  评论(0编辑  收藏  举报