Tp.Search.Bus.Commands.BuildSearchIndexesCommand.Execute C# (CSharp) Method

Execute() public method

public Execute ( string _, UserDTO user = null ) : PluginCommandResponseMessage
_ string
user Tp.Integration.Common.UserDTO
return Tp.Integration.Messages.Commands.PluginCommandResponseMessage
		public PluginCommandResponseMessage Execute(string _, UserDTO user = null)
		{
			bool wasNoProfile = _pluginContext.ProfileName.IsEmpty;
			var c = new AddOrUpdateProfileCommand(_bus, _profileCollection, _pluginContext, _pluginMetadata);
			var result = c.Execute(BuildProfileDto().Serialize());
			if (result.PluginCommandStatus == PluginCommandStatus.Succeed && wasNoProfile)
			{
				_bus.SendLocalWithContext(new ProfileName(SearcherProfile.Name), _pluginContext.AccountName, new ExecutePluginCommandCommand
					{
						CommandName = SetEnableForTp2.CommandName,
						Arguments = bool.TrueString
					});
			}
			return result;
		}

Usage Example

		public void Run()
		{
			if (_isOnSite && _profileCollection.Empty())
			{
				var c = new BuildSearchIndexesCommand(_bus, _profileCollection, _pluginContext, _pluginMetadata);
				c.Execute(string.Empty);
			}
			_log.Info("Started Search Plugin");
		}
All Usage Examples Of Tp.Search.Bus.Commands.BuildSearchIndexesCommand::Execute