コード例 #1
0
        public string ObterInformacoes()
        {
            if (Informacoes.Any())
            {
                return(string.Join(", ", Informacoes.Select(item => $"{ item.Mensagem }")));
            }

            return(string.Empty);
        }
コード例 #2
0
 public string ConsolidaMensagem(string separador)
 {
     if (Informacoes.Any())
     {
         StringBuilder sb = new StringBuilder();
         for (int i = 0; i < Informacoes.Count; ++i)
         {
             if (Informacoes[i].Length > 0)
             {
                 sb.Append(Informacoes[i]);
                 if (i < (Informacoes.Count - 1))
                 {
                     sb.Append(separador);
                 }
             }
         }
         return(sb.ToString());
     }
     else
     {
         return(string.Empty);
     }
 }