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

ValidateAdd() public method

public ValidateAdd ( MashupManagerProfile profile ) : PluginProfileErrorCollection
profile MashupManagerProfile
return PluginProfileErrorCollection
		public PluginProfileErrorCollection ValidateAdd(MashupManagerProfile profile)
		{
			var errors = new PluginProfileErrorCollection();

			ValidateNameNotEmpty(errors);
			ValidateNameContainsOnlyValidChars(errors);
			ValidateNameUniqueness(errors, profile);

			return errors;
		}

Usage Example

		public PluginProfileErrorCollection Add(Mashup dto, bool generateUniqueName)
		{
			if (generateUniqueName)
			{
				dto.Name = GetUniqueMashupName(dto.Name);
			}

			var errors = dto.ValidateAdd(ManagerProfile);
			if (errors.Any())
			{
				return errors;
			}

			AddMashupNameToPlugin(dto.Name);
			_scriptStorage.SaveMashup(dto);
			_bus.Send(dto.CreatePluginMashupMessage());
			_log.InfoFormat("Add mashup command sent to TP (Mashup '{0}' for account '{1}')", dto.Name, _context.AccountName.Value);
			return errors;
		}
All Usage Examples Of Tp.MashupManager.Mashup::ValidateAdd