Tp.MashupManager.Mashup.ValidateNameUniqueness C# (CSharp) Method

ValidateNameUniqueness() protected method

protected ValidateNameUniqueness ( PluginProfileErrorCollection errors, MashupManagerProfile profile ) : void
errors PluginProfileErrorCollection
profile MashupManagerProfile
return void
		protected void ValidateNameUniqueness(PluginProfileErrorCollection errors, MashupManagerProfile profile)
		{
			if (errors.Any())
				return;

			var existsSuchName = profile != null && profile.MashupNames
															.Any(
																m => m.Equals(Name, StringComparison.InvariantCultureIgnoreCase));

			if (existsSuchName)
			{
				errors.Add(new PluginProfileError
				{
					FieldName = NameField,
					Message = "Mashup with the same name already exists"
				});
			}
		}