Castle.Components.Validator.ErrorSummary.GetErrorsForProperty C# (CSharp) Method

GetErrorsForProperty() public method

Gets the errors for a property.
public GetErrorsForProperty ( string name ) : string[]
name string The property name.
return string[]
		public string[] GetErrorsForProperty(string name)
		{
			if (name == null) throw new ArgumentNullException("name");

			if (!property2Messages.ContainsKey(name))
			{
				return new string[0];
			}

			string[] messages = property2Messages[name];

			return messages;
		}

Usage Example

示例#1
0
 /// <summary>
 /// Registers the errors from another error summary instance.
 /// </summary>
 /// <param name="errorSummary">The error summary.</param>
 public void RegisterErrorsFrom(ErrorSummary errorSummary)
 {
     foreach (string property in errorSummary.InvalidProperties)
     {
         foreach (string errorMessage in errorSummary.GetErrorsForProperty(property))
         {
             RegisterErrorMessage(property, errorMessage);
         }
     }
 }
All Usage Examples Of Castle.Components.Validator.ErrorSummary::GetErrorsForProperty