Skip to content

Commit a012602

Browse files
committed
Atualização do método ChainProperty para suportar nulls
* Suporte a tipos de referência anuláveis - Alterado o tipo de parâmetro para string? para aceitar nulls. * Melhoria na documentação XML - Tradução da documentação de português para inglês. - Adição de descrições sobre o comportamento com valores nulos.
1 parent 822c8bd commit a012602

1 file changed

Lines changed: 15 additions & 9 deletions

File tree

src/RoyalCode.SmartProblems/Problem.cs

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -99,11 +99,14 @@ public Problem With<TEnum>(string key, TEnum value)
9999
}
100100

101101
/// <summary>
102-
/// Encadeia uma propriedade ao início da propriedade atual, formando uma propriedade aninhada (ex: Endereco.Rua).
102+
/// Chains a property to the beginning of the current property, forming a nested property (e.g. Parent.Current).
103103
/// </summary>
104-
/// <param name="parentProperty">Nome da propriedade a ser encadeada.</param>
105-
/// <returns>Esta instância de Problem com a propriedade modificada.</returns>
106-
public Problem ChainProperty(string parentProperty)
104+
/// <remarks>
105+
/// When <see cref="Property"/> or <paramref name="parentProperty"/> is null or empty, this method does nothing.
106+
/// </remarks>
107+
/// <param name="parentProperty">Name of the property to be chained.</param>
108+
/// <returns>The same instance of the problem.</returns>
109+
public Problem ChainProperty(string? parentProperty)
107110
{
108111
if (string.IsNullOrEmpty(parentProperty) || string.IsNullOrEmpty(_property))
109112
return this;
@@ -113,12 +116,15 @@ public Problem ChainProperty(string parentProperty)
113116
}
114117

115118
/// <summary>
116-
/// Encadeia uma propriedade de coleção com índice ao início da propriedade atual (ex: Endereco[0].Rua).
119+
/// Chains a collection property with index to the beginning of the current property (e.g. Parent[0].Current).
117120
/// </summary>
118-
/// <param name="parentProperty">Nome da propriedade de coleção.</param>
119-
/// <param name="index">Índice da coleção.</param>
120-
/// <returns>Esta instância de Problem com a propriedade modificada.</returns>
121-
public Problem ChainProperty(string parentProperty, int index)
121+
/// <remarks>
122+
/// When <see cref="Property"/> or <paramref name="parentProperty"/> is null or empty, this method does nothing.
123+
/// </remarks>
124+
/// <param name="parentProperty">Name of the property to be chained.</param>
125+
/// <param name="index">Collection index.</param>
126+
/// <returns>The same instance of the problem.</returns>
127+
public Problem ChainProperty(string? parentProperty, int index)
122128
{
123129
if (string.IsNullOrEmpty(parentProperty) || string.IsNullOrEmpty(_property))
124130
return this;

0 commit comments

Comments
 (0)