Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pawelgradecki/2988f09eeff2ae6d9cb30aecfd855771 to your computer and use it in GitHub Desktop.
Save pawelgradecki/2988f09eeff2ae6d9cb30aecfd855771 to your computer and use it in GitHub Desktop.
multi entity plugin with interface
public void Execute(IServiceProvider serviceProvider)
{
var context = serviceProvider.GetService(typeof(IPluginExecutionContext)) as IPluginExecutionContext;
var serviceFactory = serviceProvider.GetService(typeof(IOrganizationServiceFactory)) as IOrganizationServiceFactory;
var service = serviceFactory.CreateOrganizationService(context.UserId);
var earlyBound = (context.InputParameters["Target"] as Entity).Mock<IEntityWithTotalSum>();
earlyBound.new_totalsum = earlyBound.new_netamount + earlyBound.new_margin;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment