27 lines
974 B
C#
27 lines
974 B
C#
using BS.Shared.Interface;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace BS.Shared.Extensions
|
|
{
|
|
public static class ContactExtensions
|
|
{
|
|
public static string GetPrivatePhoneNumber(this IEnumerable<IContact> contacts)
|
|
=> contacts.GetInformation(ContactType.private_Phone);
|
|
public static string GetPrivateMobilePhoneNumber(this IEnumerable<IContact> contacts)
|
|
=> contacts.GetInformation(ContactType.private_MobilePhone);
|
|
public static string GetPrivateFaxNumber(this IEnumerable<IContact> contacts)
|
|
=> contacts.GetInformation(ContactType.private_Fax);
|
|
public static string GetPrivateMailNumber(this IEnumerable<IContact> contacts)
|
|
=> contacts.GetInformation(ContactType.private_Mail);
|
|
|
|
public static string GetInformation(this IEnumerable<IContact> contacts, ContactType contactType)
|
|
{
|
|
return contacts?.FirstOrDefault(x => x.Type == contactType)?.Value;
|
|
}
|
|
}
|
|
}
|