public static async Task <byte[]> ConvertToByteArray(this IFormFile formFile) { using var memoryStream = await formFile.ConvertToMemoryStream(); return(memoryStream.ToArray()); }