示例#1
0
 /// <summary>
 /// Retrieves the specified property if it exists; otherwise, creates the property and returns it.
 /// </summary>
 /// <typeparam name="TProperty">The type of the property.</typeparam>
 /// <param name="createProperty">The delegate used to create the property.</param>
 /// <param name="propertyName">The name of the property.</param>
 protected override TProperty GetOrAddProperty <TProperty>(Func <TProperty> createProperty, string propertyName)
 {
     return(_properties.GetOrAdd(createProperty, propertyName));
 }
示例#2
0
 /// <summary>
 /// Retrieves the specified property validator if it exists; otherwise, creates the validator and returns it.
 /// </summary>
 /// <typeparam name="TProperty">The type of the property.</typeparam>
 /// <param name="createValidator">The delegate used to create the validator.</param>
 /// <param name="propertyName">The name of the property or <see cref="String.Empty"/>.</param>
 protected override TProperty GetOrAddProperty <TProperty>(Func <TProperty> createValidator, string propertyName)
 {
     return(_errors.GetOrAdd(createValidator, propertyName));
 }