Taviloglu.Wrike.ApiClient.Extensions/ContactsExtensions.cs
/// <summary>
/// Retrieves the first contact record having type person and provided email 
/// </summary>
/// <param name="email"></param>
Retrieves the first contact record having type person and provided email
Retrieves the first contact record having type person and provided email
public static async Task<WrikeUser> GetContactByEmailAsync(this IWrikeContactsClient wrikeContactsClient,string email)
        {
            if (string.IsNullOrWhiteSpace(email))
            {
                throw new ArgumentNullException(nameof(email));
            }
            var contacts = await wrikeContactsClient.GetAsync();
            return contacts.Where(c =>
            c.Type == WrikeUserType.Person &&
            c.Profiles.Any(p=> p.Email == email)).FirstOrDefault();
        }
public static async Task < WrikeUser > GetContactByEmailAsync ( this IWrikeContactsClient wrikeContactsClient , string email ) { if ( string . IsNullOrWhiteSpace ( email ) ) { throw new ArgumentNullException ( nameof ( email ) ) ; } var contacts = await wrikeContactsClient . GetAsync ( ) ; return contacts . Where ( c => c . Type == WrikeUserType . Person && c . Profiles . Any ( p => p . Email == email ) ) . FirstOrDefault ( ) ; }
Retrieves the first contact record having type person and provided email
Retrieves the first contact record having type person and provided email
IWrikeContactsClient
this
email
string
None