protected virtual void Validate(IPluginContext context, Type pluginType) { var attributes = new PluginAttributesCollection(pluginType); if (attributes.ExecutionModes.Any()) { context.EnsureSupportedExecutionMode(attributes.ExecutionModes.ToArray()); } if (attributes.PipelineStages.Any()) { context.EnsureSupportedPipelineStage(attributes.PipelineStages.ToArray()); } if (attributes.PipelineMessages.Any()) { context.EnsureSupportedMessage(attributes.PipelineMessages.ToArray()); } if (!String.IsNullOrWhiteSpace(attributes.PrimaryEntityLogicalName)) { context.EnsureTargetLogicalName(attributes.PrimaryEntityLogicalName); } }