protected virtual void CheckIfAnswerHasPII(ChatState state, PIIType piiType, string answer, string mask) { if ((piiType != PIIType.None) && !String.IsNullOrEmpty(answer)) { state.AddPIIText(piiType, answer, mask); } }
public void AddPiiText(int piiType, object text, object mask) { if (!(text is string textText)) { throw new ApplicationException($"{nameof(AddPiiText)}: {nameof(text)} must be a string"); } if (!(mask is string maskText)) { throw new ApplicationException($"{nameof(AddPiiText)}: {nameof(mask)} must be a string"); } if (String.IsNullOrEmpty(textText)) { return; } PIIType pii = (PIIType)piiType; chatModel.CurrentState.AddPIIText(pii, textText, maskText); }