Skip to content

Commit 4a0f22a

Browse files
committed
update code
1 parent 5b54403 commit 4a0f22a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

source/upgrade/v3.txt

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,11 @@ Version 3.0 Breaking Changes
227227
page to learn how to do so.
228228

229229
Alternatively, you can check each item's type in a different way. For example, you
230-
can call the item's ``GetType()`` method and compare the result to the type you're
231-
looking for, as shown here: ``item.GetType() == typeof(T)``
230+
can call the ``Where()`` method and pass an expression that compares the item's type
231+
to the type you're looking for, as in the following example:
232+
233+
.. code-block:: csharp
234+
235+
collection.AsQueryable().Where(item => item.GetType() == typeof(T));
232236

233237
To learn more about type discriminators, see :ref:`<csharp-polymorphism>`.

0 commit comments

Comments
 (0)