Skip to content

Commit

Permalink
Example caused error CS0136. (#41)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bkoelman authored and dennisdoomen committed Oct 7, 2016
1 parent 288655d commit 17ccc17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Guidelines/2200_FrameworkGuidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down

0 comments on commit 17ccc17

Please sign in to comment.