README.md: prefer OfType<>() LINQ method, it's shorter

Based on dfc89dc3ab
This commit is contained in:
Andres G. Aragoneses 2020-04-14 06:46:44 +08:00
parent 6b9fc62634
commit 56448c6410

View file

@ -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<TLUser>()
.OfType<TLUser>()
.FirstOrDefault(x => x.Phone == "<recipient_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<TLChannel>()
.OfType<TLChannel>()
.FirstOrDefault(c => c.Title == "<channel_title>");
//send message