From 56448c641090b0d695496ce866052c9cfb22696a Mon Sep 17 00:00:00 2001 From: "Andres G. Aragoneses" Date: Tue, 14 Apr 2020 06:46:44 +0800 Subject: [PATCH] README.md: prefer OfType<>() LINQ method, it's shorter Based on dfc89dc3ab2ddcb12f77b236b777cb304d3d478d --- README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 24d6bd5..62b17ff 100644 --- a/README.md +++ b/README.md @@ -81,8 +81,7 @@ You can call any method on authenticated users. For example, let's send message //find recipient in contacts var user = result.Users - .Where(x => x.GetType() == typeof (TLUser)) - .Cast() + .OfType() .FirstOrDefault(x => x.Phone == ""); //send message @@ -99,8 +98,7 @@ To send a message to a channel you could use the following code: //find channel by title var chat = dialogs.Chats - .Where(c => c.GetType() == typeof(TLChannel)) - .Cast() + .OfType() .FirstOrDefault(c => c.Title == ""); //send message