From 2707242ab772e8e94fe2b53ec2ec7e58a4152d2d Mon Sep 17 00:00:00 2001 From: NourEldin Yasser Date: Wed, 10 Feb 2021 18:23:50 +0200 Subject: [PATCH 1/4] [textanalytics] Add Debug Proxy class for ExtractKeyPhrasesResultCollection --- .../src/ExtractKeyPhrasesResultCollection.cs | 2 + ...ractKeyPhrasesResultCollectionDebugView.cs | 62 +++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs index 342457f4e528..8a4483ab384c 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; namespace Azure.AI.TextAnalytics { @@ -10,6 +11,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(ExtractKeyPhrasesResultCollectionDebugView))] public class ExtractKeyPhrasesResultCollection : ReadOnlyCollection { internal ExtractKeyPhrasesResultCollection(IList list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs new file mode 100644 index 000000000000..f96c2ae4497e --- /dev/null +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Collections.Generic; +using System.Linq; + +namespace Azure.AI.TextAnalytics +{ + /// + /// Debugger Proxy class for . + /// + public class ExtractKeyPhrasesResultCollectionDebugView + { + private ExtractKeyPhrasesResultCollection BaseCollection { get; } + + /// + /// Initializes a new instance of the class. + /// + /// + public ExtractKeyPhrasesResultCollectionDebugView(ExtractKeyPhrasesResultCollection collection) + { + BaseCollection = collection; + } + + /// + /// Collection of objects corresponding + /// to a batch of documents. + /// + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + /// + /// Gets statistics about the documents and how it was processed + /// by the service. This property will have a value when IncludeStatistics + /// is set to true in the client call. + /// + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + /// + /// Gets the version of the Text Analytics model used by this operation + /// on this batch of documents. + /// + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } +} From 3ced73a09211f862ccd311e1d869a3409d1986fb Mon Sep 17 00:00:00 2001 From: NourEldin Yasser Date: Thu, 18 Feb 2021 12:38:36 +0200 Subject: [PATCH 2/4] [textanalytics] Add DebugView for ExtractKeyPhraseResultCollection as an inner class --- .../src/ExtractKeyPhrasesResultCollection.cs | 39 ++++++++++++ ...ractKeyPhrasesResultCollectionDebugView.cs | 62 ------------------- 2 files changed, 39 insertions(+), 62 deletions(-) delete mode 100644 sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs index 8a4483ab384c..f85568cc7d70 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollection.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -32,5 +33,43 @@ internal ExtractKeyPhrasesResultCollection(IList list, /// on this batch of documents. /// public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class ExtractKeyPhrasesResultCollectionDebugView + { + private ExtractKeyPhrasesResultCollection BaseCollection { get; } + + public ExtractKeyPhrasesResultCollectionDebugView(ExtractKeyPhrasesResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs deleted file mode 100644 index f96c2ae4497e..000000000000 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/ExtractKeyPhrasesResultCollectionDebugView.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -using System.Collections.Generic; -using System.Linq; - -namespace Azure.AI.TextAnalytics -{ - /// - /// Debugger Proxy class for . - /// - public class ExtractKeyPhrasesResultCollectionDebugView - { - private ExtractKeyPhrasesResultCollection BaseCollection { get; } - - /// - /// Initializes a new instance of the class. - /// - /// - public ExtractKeyPhrasesResultCollectionDebugView(ExtractKeyPhrasesResultCollection collection) - { - BaseCollection = collection; - } - - /// - /// Collection of objects corresponding - /// to a batch of documents. - /// - public List Items - { - get - { - return BaseCollection.ToList(); - } - } - - /// - /// Gets statistics about the documents and how it was processed - /// by the service. This property will have a value when IncludeStatistics - /// is set to true in the client call. - /// - public TextDocumentBatchStatistics Statistics - { - get - { - return BaseCollection.Statistics; - } - } - - /// - /// Gets the version of the Text Analytics model used by this operation - /// on this batch of documents. - /// - public string ModelVersion - { - get - { - return BaseCollection.ModelVersion; - } - } - } -} From cca7e4b361c394d3f8c6d9b340a0fef7ddb53a8c Mon Sep 17 00:00:00 2001 From: NourEldin Yasser Date: Sun, 21 Feb 2021 13:53:21 +0200 Subject: [PATCH 3/4] [textanalytics] Add DebuggerProxy to Custom Collections --- ...alyzeHealthcareEntitiesResultCollection.cs | 41 +++++++++++++++++++ .../src/AnalyzeSentimentResultCollection.cs | 41 +++++++++++++++++++ .../src/CategorizedEntityCollection.cs | 33 +++++++++++++++ .../src/DetectLanguageResultCollection.cs | 41 +++++++++++++++++++ .../src/KeyPhraseCollection.cs | 33 +++++++++++++++ .../src/LinkedEntityCollection.cs | 33 +++++++++++++++ .../src/PiiEntityCollection.cs | 33 +++++++++++++++ .../src/RecognizeEntitiesResultCollection.cs | 41 +++++++++++++++++++ ...RecognizeLinkedEntitiesResultCollection.cs | 41 +++++++++++++++++++ .../RecognizePiiEntitiesResultCollection.cs | 41 +++++++++++++++++++ 10 files changed, 378 insertions(+) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesResultCollection.cs index bea8b389222d..016f15e3dda9 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeHealthcareEntitiesResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(AnalyzeHealthcareEntitiesResultCollectionDebugView))] public class AnalyzeHealthcareEntitiesResultCollection : ReadOnlyCollection { /// @@ -35,5 +38,43 @@ internal AnalyzeHealthcareEntitiesResultCollection(IList public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class AnalyzeHealthcareEntitiesResultCollectionDebugView + { + private AnalyzeHealthcareEntitiesResultCollection BaseCollection { get; } + + public AnalyzeHealthcareEntitiesResultCollectionDebugView(AnalyzeHealthcareEntitiesResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeSentimentResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeSentimentResultCollection.cs index 30b3f2acab59..e863b3338ce9 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeSentimentResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/AnalyzeSentimentResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(AnalyzeSentimentResultCollectionDebugView))] public class AnalyzeSentimentResultCollection : ReadOnlyCollection { internal AnalyzeSentimentResultCollection(IList list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list) @@ -30,5 +33,43 @@ internal AnalyzeSentimentResultCollection(IList list, Te /// on this batch of documents. /// public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class AnalyzeSentimentResultCollectionDebugView + { + private AnalyzeSentimentResultCollection BaseCollection { get; } + + public AnalyzeSentimentResultCollectionDebugView(AnalyzeSentimentResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntityCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntityCollection.cs index 949e9151b222..c31407377267 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntityCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/CategorizedEntityCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects in a document, /// and warnings encountered while processing the document. /// + [DebuggerTypeProxy(typeof(CategorizedEntityCollectionDebugView))] public class CategorizedEntityCollection : ReadOnlyCollection { internal CategorizedEntityCollection(IList entities, IList warnings) @@ -22,5 +25,35 @@ internal CategorizedEntityCollection(IList entities, IList public IReadOnlyCollection Warnings { get; } + + /// + /// Debugger Proxy class for . + /// + internal class CategorizedEntityCollectionDebugView + { + private CategorizedEntityCollection BaseCollection { get; } + + public CategorizedEntityCollectionDebugView(CategorizedEntityCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public IReadOnlyCollection Warnings + { + get + { + return BaseCollection.Warnings; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/DetectLanguageResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/DetectLanguageResultCollection.cs index 8a89d927856a..a82734cace0b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/DetectLanguageResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/DetectLanguageResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(DetectLanguageResultCollectionDebugView))] public class DetectLanguageResultCollection : ReadOnlyCollection { /// @@ -35,5 +38,43 @@ internal DetectLanguageResultCollection(IList list, TextDo /// on this batch of documents. /// public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class DetectLanguageResultCollectionDebugView + { + private DetectLanguageResultCollection BaseCollection { get; } + + public DetectLanguageResultCollectionDebugView(DetectLanguageResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/KeyPhraseCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/KeyPhraseCollection.cs index c0a6ad6192d9..c75f4cbb44c7 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/KeyPhraseCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/KeyPhraseCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of key phrases present in a document, /// and warnings encountered while processing the document. /// + [DebuggerTypeProxy(typeof(KeyPhraseCollectionDebugView))] public class KeyPhraseCollection : ReadOnlyCollection { internal KeyPhraseCollection(IList keyPhrases, IList warnings) @@ -22,5 +25,35 @@ internal KeyPhraseCollection(IList keyPhrases, IList public IReadOnlyCollection Warnings { get; } + + /// + /// Debugger Proxy class for . + /// + internal class KeyPhraseCollectionDebugView + { + private KeyPhraseCollection BaseCollection { get; } + + public KeyPhraseCollectionDebugView(KeyPhraseCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public IReadOnlyCollection Warnings + { + get + { + return BaseCollection.Warnings; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityCollection.cs index a1493477d2bf..1f40b29a545b 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/LinkedEntityCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects in a document, /// and warnings encountered while processing the document. /// + [DebuggerTypeProxy(typeof(LinkedEntityCollectionDebugView))] public class LinkedEntityCollection : ReadOnlyCollection { internal LinkedEntityCollection(IList entities, IList warnings) @@ -22,5 +25,35 @@ internal LinkedEntityCollection(IList entities, IList public IReadOnlyCollection Warnings { get; } + + /// + /// Debugger Proxy class for . + /// + internal class LinkedEntityCollectionDebugView + { + private LinkedEntityCollection BaseCollection { get; } + + public LinkedEntityCollectionDebugView(LinkedEntityCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public IReadOnlyCollection Warnings + { + get + { + return BaseCollection.Warnings; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs index 084a6b9bc300..909e7d5f77fb 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects in a document, /// and warnings encountered while processing the document. /// + [DebuggerTypeProxy(typeof(PiiEntityCollectionDebugView))] public class PiiEntityCollection : ReadOnlyCollection { internal PiiEntityCollection(IList entities, string redactedText, IList warnings) @@ -29,5 +32,35 @@ internal PiiEntityCollection(IList entities, string redactedText, ILi /// Warnings encountered while processing the document. /// public IReadOnlyCollection Warnings { get; } + + /// + /// Debugger Proxy class for . + /// + internal class PiiEntityCollectionDebugView + { + private PiiEntityCollection BaseCollection { get; } + + public PiiEntityCollectionDebugView(PiiEntityCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public IReadOnlyCollection Warnings + { + get + { + return BaseCollection.Warnings; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeEntitiesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeEntitiesResultCollection.cs index 0ee841a703ae..f1f8cfb388af 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeEntitiesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeEntitiesResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(RecognizeEntitiesResultCollectionDebugView))] public class RecognizeEntitiesResultCollection : ReadOnlyCollection { internal RecognizeEntitiesResultCollection(IList list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list) @@ -30,5 +33,43 @@ internal RecognizeEntitiesResultCollection(IList list, /// on this batch of documents. /// public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class RecognizeEntitiesResultCollectionDebugView + { + private RecognizeEntitiesResultCollection BaseCollection { get; } + + public RecognizeEntitiesResultCollectionDebugView(RecognizeEntitiesResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeLinkedEntitiesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeLinkedEntitiesResultCollection.cs index dd3280b09fde..5d8575a88882 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeLinkedEntitiesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizeLinkedEntitiesResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(RecognizeLinkedEntitiesResultCollectionDebugView))] public class RecognizeLinkedEntitiesResultCollection : ReadOnlyCollection { internal RecognizeLinkedEntitiesResultCollection(IList list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list) @@ -30,5 +33,43 @@ internal RecognizeLinkedEntitiesResultCollection(IList public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class RecognizeLinkedEntitiesResultCollectionDebugView + { + private RecognizeLinkedEntitiesResultCollection BaseCollection { get; } + + public RecognizeLinkedEntitiesResultCollectionDebugView(RecognizeLinkedEntitiesResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizePiiEntitiesResultCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizePiiEntitiesResultCollection.cs index 0f9f3f6d8159..661bbc233af1 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizePiiEntitiesResultCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/RecognizePiiEntitiesResultCollection.cs @@ -3,6 +3,8 @@ using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Linq; namespace Azure.AI.TextAnalytics { @@ -10,6 +12,7 @@ namespace Azure.AI.TextAnalytics /// Collection of objects corresponding /// to a batch of documents, and information about the batch operation. /// + [DebuggerTypeProxy(typeof(RecognizePiiEntitiesResultCollectionDebugView))] public class RecognizePiiEntitiesResultCollection : ReadOnlyCollection { internal RecognizePiiEntitiesResultCollection(IList list, TextDocumentBatchStatistics statistics, string modelVersion) : base(list) @@ -30,5 +33,43 @@ internal RecognizePiiEntitiesResultCollection(IList /// on this batch of documents. /// public string ModelVersion { get; } + + /// + /// Debugger Proxy class for . + /// + internal class RecognizePiiEntitiesResultCollectionDebugView + { + private RecognizePiiEntitiesResultCollection BaseCollection { get; } + + public RecognizePiiEntitiesResultCollectionDebugView(RecognizePiiEntitiesResultCollection collection) + { + BaseCollection = collection; + } + + [DebuggerBrowsable(DebuggerBrowsableState.RootHidden)] + public List Items + { + get + { + return BaseCollection.ToList(); + } + } + + public TextDocumentBatchStatistics Statistics + { + get + { + return BaseCollection.Statistics; + } + } + + public string ModelVersion + { + get + { + return BaseCollection.ModelVersion; + } + } + } } } From 35d75a510bb0c792e428a238fee562cd3c3d55dc Mon Sep 17 00:00:00 2001 From: NourEldin Yasser Date: Mon, 22 Feb 2021 18:20:00 +0200 Subject: [PATCH 4/4] [textanalytics] Add RedactedText field to PiiEntityCollectionDebugView --- .../Azure.AI.TextAnalytics/src/PiiEntityCollection.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs index 909e7d5f77fb..fd27010ec5ae 100644 --- a/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs +++ b/sdk/textanalytics/Azure.AI.TextAnalytics/src/PiiEntityCollection.cs @@ -61,6 +61,14 @@ public IReadOnlyCollection Warnings return BaseCollection.Warnings; } } + + public string RedactedText + { + get + { + return BaseCollection.RedactedText; + } + } } } }