Code before the changes:
List<ProductBrandModel> model = brands.Select(item => Mapper.Map<ProductBrand, ProductBrandModel>(item)).ToList();
Code after the improvement:
List<ProductBrandModel> model = brands.Select(Mapper.Map<ProductBrand, ProductBrandModel>).ToList();
What is this doing? Is it implicitly running that mapping on every item in the brands
collection?
private static void ParallelForEach() { Parallel.Invoke(() => Method1(), () => Method2()); } private static void Method1() { //do some work } private static void Method2() { //do some work }
– Kaunas