125 references to ToArray
Aspire.Azure.AI.OpenAI.Tests (1)
AspireAzureOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (1)
218Assert.Equal(1.23f, vector.ToArray().Single());
Aspire.OpenAI.Tests (2)
AspireOpenAIClientBuilderEmbeddingGeneratorExtensionsTests.cs (2)
221Assert.Equal(1.23f, vector.ToArray().Single()); 255Assert.Equal(1.23f, vector.ToArray().Single());
InMemory.FunctionalTests (3)
Http3\WebTransport\WebTransportStreamTests.cs (1)
50Assert.Equal(input.ToArray(), memoryOut.ToArray());
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (2)
144byte[] serial = certificate.SerialNumberBytes.ToArray(); 220byte[] serial = _cert.SerialNumberBytes.ToArray();
Microsoft.AspNetCore.Components (1)
PersistentState\PersistentValueProviderComponentSubscription.cs (1)
198_state.PersistAsBytes(_storageKey, writer.WrittenMemory.ToArray());
Microsoft.AspNetCore.Http.Results.Tests (5)
ResultsTests.cs (2)
1618Assert.Equal(content, result.ResponseContent.ToArray()); 1635Assert.Equal(content, result.ResponseContent.ToArray());
TypedResultsTests.cs (2)
1397Assert.Equal(content, result.ResponseContent.ToArray()); 1414Assert.Equal(content, result.ResponseContent.ToArray());
Utf8ContentResultTests.cs (1)
25Assert.Equal(data, result.ResponseContent.ToArray());
Microsoft.AspNetCore.Identity (4)
PasskeyHandler.cs (1)
332var credentialId = attestedCredentialData.CredentialId.ToArray();
Passkeys\AttestedCredentialData.cs (1)
72var credentialId = data.Slice(offset, credentialIdLength).ToArray();
Passkeys\BufferSource.cs (1)
65=> _bytes.ToArray();
Passkeys\CredentialPublicKey.cs (1)
253public byte[] ToArray() => _bytes.ToArray();
Microsoft.AspNetCore.Identity.Test (5)
Passkeys\PasskeyHandlerAssertionTest.cs (4)
806var newRpIdHash = args.RpIdHash.ToArray(); 823var newClientDataHash = clientDataHash.ToArray(); 1013CredentialId.ToArray(), 1014credentialPublicKey.ToArray(),
Passkeys\PasskeyHandlerAttestationTest.cs (1)
942var newCredentialId = args.CredentialId.ToArray();
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
Infrastructure\DefaultTempDataSerializer.cs (1)
213return bufferWriter.WrittenMemory.ToArray();
Microsoft.AspNetCore.OutputCaching.Tests (2)
CachedResponseBodyTests.cs (1)
108receivedSegments.Add(memory.ToArray());
TestUtils.cs (1)
371=> SetAsync(key, value.ToArray(), tags.ToArray(), validFor, cancellationToken);
Microsoft.AspNetCore.ResponseCaching.Tests (1)
CachedResponseBodyTests.cs (1)
112receivedSegments.Add(memory.ToArray());
Microsoft.AspNetCore.Server.Kestrel.Core.Tests (2)
src\Servers\Kestrel\shared\test\CertificateAuthority.cs (2)
144byte[] serial = certificate.SerialNumberBytes.ToArray(); 220byte[] serial = _cert.SerialNumberBytes.ToArray();
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (4)
DefaultHubMessageSerializerTests.cs (2)
33allBytes.AddRange(message.Serialized.ToArray()); 59serializedHubMessage[0].Serialized.ToArray());
RedisProtocolTests.cs (2)
158expected.Message.GetSerializedMessage(hubProtocol).ToArray(), 159decoded.Message.GetSerializedMessage(hubProtocol).ToArray());
Microsoft.AspNetCore.SignalR.Tests (3)
SerializedHubMessageTests.cs (3)
24Assert.Equal(DummyHubProtocol.DummySerialization, serialized.ToArray()); 42Assert.Equal(DummyHubProtocol.DummySerialization, serialized.ToArray()); 88Assert.Equal(DummyHubProtocol.DummySerialization, serializedMessage.Serialized.ToArray());
Microsoft.Extensions.AI.Abstractions (4)
Contents\DataContent.cs (2)
243return $"MediaType = {MediaType}, Text = \"{Encoding.UTF8.GetString(Data.ToArray())}\""; 248return $"JSON = {Encoding.UTF8.GetString(Data.ToArray())}";
SpeechToText\SpeechToTextClientExtensions.cs (2)
51new MemoryStream(audioSpeechContent.Data.ToArray()); 73new MemoryStream(audioSpeechContent.Data.ToArray());
Microsoft.Extensions.AI.Abstractions.Tests (21)
ChatCompletion\ChatResponseUpdateTests.cs (1)
152Assert.Equal("data"u8.ToArray(), ((DataContent)result.Contents[3]).Data.ToArray());
Contents\DataContentTests.cs (4)
146Assert.Equal([0x01, 0x02, 0x03, 0x04], content.Data.ToArray()); 169Assert.Equal([0x01, 0x02, 0x03, 0x04], content.Data.ToArray()); 256Assert.Equal(data, content.Data.ToArray()); 268Assert.Equal("hello world", Encoding.ASCII.GetString(content.Data.ToArray()));
Embeddings\EmbeddingTests.cs (11)
30Assert.Equal(floats, e.Vector.ToArray()); 49Assert.Equal(e.Vector.ToArray(), result.Vector.ToArray()); 62Assert.Equal(e.Vector.ToArray(), result.Vector.ToArray()); 76Assert.Equal(e.Vector.ToArray(), result.Vector.ToArray()); 90Assert.Equal(e.Vector.ToArray(), result.Vector.ToArray()); 103Assert.Equal(e.Vector.ToArray(), result.Vector.ToArray());
Image\ImageGenerationResponseTests.cs (1)
117Assert.Equal([1, 2, 3, 4], dataContent.Data.ToArray());
Image\ImageGeneratorExtensionsTests.cs (1)
121Assert.Equal(imageData, dataContent.Data.ToArray());
ResponseContinuationTokenTests.cs (3)
20Assert.Equal(testBytes, token.ToBytes().ToArray()); 35Assert.Equal(originalToken.ToBytes().ToArray(), deserializedToken.ToBytes().ToArray());
Microsoft.Extensions.AI.Integration.Tests (3)
EmbeddingGeneratorIntegrationTests.cs (2)
57Assert.NotEmpty(embeddings[0].Vector.ToArray()); 78Assert.NotEmpty(embedding.Vector.ToArray());
ImageGeneratingChatClientIntegrationTests.cs (1)
176Assert.Equal(testImageData, originalImageContent.Data.ToArray());
Microsoft.Extensions.AI.OpenAI (1)
OpenAIImageGenerator.cs (1)
74new MemoryStream(dataContent.Data.ToArray());
Microsoft.Extensions.AI.OpenAI.Tests (5)
OpenAIAssistantChatClientIntegrationTests.cs (1)
78Assert.NotEmpty(codeInput.Data.ToArray());
OpenAIEmbeddingGeneratorTests.cs (2)
146Assert.Contains(e.Vector.ToArray(), f => !f.Equals(0)); 215Assert.Contains(e.Vector.ToArray(), f => !f.Equals(0));
OpenAIResponseClientIntegrationTests.cs (1)
51Assert.NotEmpty(codeInput.Data.ToArray());
OpenAIResponseClientTests.cs (1)
2943Assert.Contains("sum_of_numbers", Encoding.UTF8.GetString(codeInput.Data.ToArray()));
Microsoft.Extensions.AI.Tests (4)
Embeddings\DistributedCachingEmbeddingGeneratorTest.cs (4)
324Assert.NotEqual(result1.Vector.ToArray(), result4.Vector.ToArray()); 407Assert.Equal(expected.Vector.ToArray(), actual.Vector.ToArray());
Microsoft.Extensions.DataIngestion.Tests (7)
Processors\AlternativeTextEnricherTests.cs (4)
56Assert.Equal(_imageContent.ToArray(), dataContent.Data.ToArray()); 143Assert.Equal(_imageContent.ToArray(), dataContent.Data.ToArray());
Readers\MarkdownReaderTests.cs (3)
94Assert.Equal(imageBytes1, images[0].Content?.ToArray()); 97Assert.Equal(imageBytes2, images[1].Content?.ToArray()); 100Assert.Equal(imageBytes3, images[2].Content?.ToArray());
Microsoft.ML.AutoML (1)
ColumnInference\PurposeInference.cs (1)
99var copy = new ReadOnlyMemory<char>(value.ToArray());
Microsoft.ML.Transforms (1)
Text\WordEmbeddingsExtractor.cs (1)
142labels.Add(new string(label.Value.ToArray()));
System.Memory.Data (1)
System\BinaryData.cs (1)
437public byte[] ToArray() => _bytes.ToArray();
System.Net.Security (3)
System\Net\Security\SslConnectionInfo.cs (3)
9private static readonly byte[] s_http1 = SslApplicationProtocol.Http11.Protocol.ToArray(); 10private static readonly byte[] s_http2 = SslApplicationProtocol.Http2.Protocol.ToArray(); 11private static readonly byte[] s_http3 = SslApplicationProtocol.Http3.Protocol.ToArray();
System.Private.CoreLib (1)
src\libraries\System.Private.CoreLib\src\System\MemoryDebugView.cs (1)
23public T[] Items => _memory.ToArray();
System.Security.Cryptography (16)
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (1)
279valueColl.Add(CreateBestPkcs9AttributeObjectAvailable(type, attrValue.ToArray()));
src\libraries\Common\src\System\Security\Cryptography\KeyBlobHelpers.cs (2)
15return memory.Slice(1).ToArray(); 18return memory.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
133return _sealedData.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
60ReadOnlyMemory<byte> maybeCopy = skipCopy ? firstValue : firstValue.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
51EncodedBagValue = skipCopy ? encodedBagValue : encodedBagValue.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
40AlgorithmParameters = skipCopies ? algorithmParameters : algorithmParameters?.ToArray(); 41PrivateKeyBytes = skipCopies ? privateKey : privateKey.ToArray();
src\libraries\Common\src\System\Security\Cryptography\RSAOpenSsl.cs (4)
370return ExportPrivateKey(static (pkcs8, pkcs1) => pkcs8.ToArray()); 380return ExportPrivateKey(static (pkcs8, pkcs1) => pkcs1.ToArray()); 390return pkcs1.ToArray(); 409return ExportPublicKey(static spki => spki.ToArray());
System\Security\Cryptography\EccKeyFormatHelper.cs (1)
177D = key.PrivateKey.ToArray(),
System\Security\Cryptography\KeyBlobHelpers.cs (1)
14return memory.ToArray();
System\Security\Cryptography\X509Certificates\X509Certificate.cs (1)
501return PalRawDataMemory.ToArray();
System\Security\Cryptography\X509Certificates\X509Certificate2.cs (1)
337public byte[] RawData => RawDataMemory.ToArray();
System.Security.Cryptography.Pkcs (21)
Internal\Cryptography\Pal\AnyOS\AsnHelpers.cs (3)
23var name = new X500DistinguishedName(originator.IssuerAndSerialNumber.Value.Issuer.ToArray()); 47originatorKey.PublicKey.ToArray())); 142parameters = asn.Parameters.Value.ToArray();
Internal\Cryptography\Pal\AnyOS\ManagedPal.cs (1)
113alg.IV = rc2Params.Iv.ToArray();
Internal\Cryptography\Pal\AnyOS\ManagedPal.Decode.cs (2)
35data.EncryptedContentInfo.EncryptedContent?.ToArray() ?? Array.Empty<byte>()); 101return parsedContentInfo.Content.ToArray();
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyAgree.cs (1)
25_asn.RecipientEncryptedKeys[_index].EncryptedKey.ToArray();
Internal\Cryptography\Pal\AnyOS\ManagedPal.KeyTrans.cs (1)
26_asn.EncryptedKey.ToArray();
src\libraries\Common\src\Internal\Cryptography\PkcsHelpers.cs (1)
279valueColl.Add(CreateBestPkcs9AttributeObjectAvailable(type, attrValue.ToArray()));
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Builder.cs (1)
133return _sealedData.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12Info.cs (1)
60ReadOnlyMemory<byte> maybeCopy = skipCopy ? firstValue : firstValue.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs12SafeBag.cs (1)
51EncodedBagValue = skipCopy ? encodedBagValue : encodedBagValue.ToArray();
src\libraries\Common\src\System\Security\Cryptography\Pkcs\Pkcs8PrivateKeyInfo.cs (2)
40AlgorithmParameters = skipCopies ? algorithmParameters : algorithmParameters?.ToArray(); 41PrivateKeyBytes = skipCopies ? privateKey : privateKey.ToArray();
System\Security\Cryptography\Pkcs\Rfc3161TimestampRequest.cs (1)
48rawExtension.ExtnValue.ToArray(),
System\Security\Cryptography\Pkcs\Rfc3161TimestampToken.cs (1)
443if (issuerDirectoryName != new X500DistinguishedName(requiredName.DirectoryName.Value.ToArray()).Name)
System\Security\Cryptography\Pkcs\Rfc3161TimestampTokenInfo.cs (2)
186rawExtension.ExtnValue.ToArray(), 271copiedBytes = firstElement.ToArray();
System\Security\Cryptography\Pkcs\SignedCms.cs (2)
200ContentInfo = new ContentInfo(new Oid(_contentType), contentValue.ToArray()); 233return contentInfo.Content.ToArray();
System\Security\Cryptography\Pkcs\SignerInfo.cs (1)
71public byte[] GetSignature() => _signature.ToArray();
System.Text.Json (1)
System\Text\Json\Document\JsonDocument.cs (1)
716ReadOnlyMemory<byte> segmentCopy = GetRawValue(index, includeQuotes: true).ToArray();
System.Windows.Forms.UI.IntegrationTests (1)
Infra\ScreenRecordService.cs (1)
448string type = Encoding.ASCII.GetString(chunkType.ToArray());