diff --git a/_pages/1200_MiscellaneousDesignGuidelines.md b/_pages/1200_MiscellaneousDesignGuidelines.md index 8b83faf..a11c274 100644 --- a/_pages/1200_MiscellaneousDesignGuidelines.md +++ b/_pages/1200_MiscellaneousDesignGuidelines.md @@ -85,7 +85,7 @@ Instead of casting to and from the object type in generic types or methods, use Consider the following code snippet - public IEnumerable GetGoldMemberCustomers() + public IEnumerable GetGoldMemberCustomers() { const decimal GoldMemberThresholdInEuro = 1_000_000; @@ -97,7 +97,7 @@ Consider the following code snippet return query; } -Since LINQ queries use deferred execution, returning `query` will actually return the expression tree representing the above query. Each time the caller evaluates this result using a `foreach` cycle or similar, the entire query is re-executed resulting in new instances of `GoldMember` every time. Consequently, you cannot use the `==` operator to compare multiple `GoldMember` instances. Instead, always explicitly evaluate the result of a LINQ query using `ToList()`, `ToArray()` or similar methods. +Since LINQ queries use deferred execution, returning `query` will actually return the expression tree representing the above query. Each time the caller evaluates this result using a `foreach` loop or similar, the entire query is re-executed resulting in new instances of `GoldMember` every time. Consequently, you cannot use the `==` operator to compare multiple `GoldMember` instances. Instead, always explicitly evaluate the result of a LINQ query using `ToList()`, `ToArray()` or similar methods. ### Do not use `this` and `base` prefixes unless it is required (AV1251) ![](/assets/images/1.png)