Created
April 23, 2019 18:12
-
-
Save gashupl/74c7ebe572c9583c30d55a5cc4da060d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| protected T GetTargetEntity<T>(IPluginExecutionContext pluginExecutionContext) where T: Entity | |
| { | |
| if (pluginExecutionContext.InputParameters.Contains(TargetAttributeName) && pluginExecutionContext.InputParameters[TargetAttributeName] is Entity) | |
| { | |
| return ((Entity)pluginExecutionContext.InputParameters[TargetAttributeName])?.ToEntity<T>(); | |
| } | |
| else | |
| { | |
| throw new InvalidPluginExecutionException(OperationStatus.Failed, "Missing target value or target is not an Entity"); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment