From 8bdae02dbb5d55dbab467d7dad7f0a8af1658be3 Mon Sep 17 00:00:00 2001 From: Bart Koelman Date: Thu, 6 Oct 2016 22:10:50 +0200 Subject: [PATCH] Example caused error CS0136. CS0136: A local or parameter named 'c' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter. --- Guidelines/2200_FrameworkGuidelines.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Guidelines/2200_FrameworkGuidelines.md b/Guidelines/2200_FrameworkGuidelines.md index ba90fab..71fba9a 100644 --- a/Guidelines/2200_FrameworkGuidelines.md +++ b/Guidelines/2200_FrameworkGuidelines.md @@ -40,14 +40,14 @@ Since LINQ queries should be written out over multiple lines for readability, th Lambda expressions provide a much more elegant alternative for anonymous delegates. So instead of: - Customer c = Array.Find(customers, delegate(Customer c) + Customer customer = Array.Find(customers, delegate(Customer c) { return c.Name == "Tom"; }); use a Lambda expression: - Customer c = Array.Find(customers, c => c.Name == "Tom"); + Customer customer = Array.Find(customers, c => c.Name == "Tom"); Or even better: