17 if (attachments is
null)
21 return attachments.Where(x => x.ContentType.StartsWith(
"image/", StringComparison.OrdinalIgnoreCase));
31 return attachments?.FirstOrDefault(x => x.ContentType.StartsWith(
"image/", StringComparison.OrdinalIgnoreCase));
41 public static T[]
Join<T>(
this T[] Array1, T[] Array2)
45 else if (Array2 is
null)
49 int c = Array1.Length;
50 int d = Array2.Length;
51 T[] Result =
new T[c + d];
53 Array1.CopyTo(Result, 0);
54 Array2.CopyTo(Result, c);
Extensions for generic Arrays.
static ? Attachment GetFirstImageAttachment(this Attachment[] attachments)
Returns the first image attachment of the array, if there is one.
static IEnumerable< Attachment > GetImageAttachments(this Attachment[] attachments)
Returns all the attachments whose content type starts with "image".
static T[] Join< T >(this T[] Array1, T[] Array2)
Joins two arrays.
Contains a reference to an attachment assigned to a legal object.