這是什麼ReSharper片段「轉換爲方法組」實際上在做什麼?
修改之前代碼:
List<ProductBrandModel> model = brands.Select(item => Mapper.Map<ProductBrand, ProductBrandModel>(item)).ToList();
代碼改進後:
List<ProductBrandModel> model = brands.Select(Mapper.Map<ProductBrand, ProductBrandModel>).ToList();
這是什麼做的?它是否隱式地在brands
集合中的每個項目上運行該映射?
我也面臨着同樣的問題,我下面的代碼,同時瞭解TPL: '私有靜態無效ParallelForEach() { Parallel.Invoke(()=>方法1(), ()=>方法2( )); } 私有靜態無效方法1(){ // 做一些工作 } 私有靜態無效方法2(){ // 做一些工作 }' – RBT