-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added: automatic registration option for the Create message plugin step
- Loading branch information
Showing
14 changed files
with
5,238 additions
and
23 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
LinkDev.AutoNumbering.Plugins/Config/Register/PostCreateRegisterStep.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#region Imports | ||
|
||
using System; | ||
using System.Linq; | ||
using LinkDev.AutoNumbering.Plugins.Helpers; | ||
using LinkDev.Libraries.Common; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
#endregion | ||
|
||
namespace LinkDev.AutoNumbering.Plugins.Config.Register | ||
{ | ||
public class PostCreateRegisterStep : IPlugin | ||
{ | ||
public void Execute(IServiceProvider serviceProvider) | ||
{ | ||
new PostCreateRegisterStepLogic().Execute(this, serviceProvider); | ||
} | ||
} | ||
|
||
[Log] | ||
internal class PostCreateRegisterStepLogic : PluginLogic<PostCreateRegisterStep> | ||
{ | ||
public PostCreateRegisterStepLogic() : base("Create", PluginStage.PostOperation, AutoNumbering.EntityLogicalName) | ||
{ | ||
} | ||
|
||
[NoLog] | ||
protected override void ExecuteLogic() | ||
{ | ||
var preImage = context.PreEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
var postImage = context.PostEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
new RegistrationHelper(service, log).RegisterStageConfigSteps(preImage, postImage); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
LinkDev.AutoNumbering.Plugins/Config/Register/PostUpdateRegisterStep.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#region Imports | ||
|
||
using System; | ||
using System.Linq; | ||
using LinkDev.AutoNumbering.Plugins.Helpers; | ||
using LinkDev.Libraries.Common; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
#endregion | ||
|
||
namespace LinkDev.AutoNumbering.Plugins.Config.Register | ||
{ | ||
public class PostUpdateRegisterStep : IPlugin | ||
{ | ||
public void Execute(IServiceProvider serviceProvider) | ||
{ | ||
new PostUpdateRegisterStepLogic().Execute(this, serviceProvider); | ||
} | ||
} | ||
|
||
[Log] | ||
internal class PostUpdateRegisterStepLogic : PluginLogic<PostUpdateRegisterStep> | ||
{ | ||
public PostUpdateRegisterStepLogic() : base("Update", PluginStage.PostOperation, AutoNumbering.EntityLogicalName) | ||
{ | ||
} | ||
|
||
[NoLog] | ||
protected override void ExecuteLogic() | ||
{ | ||
var preImage = context.PreEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
var postImage = context.PostEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
new RegistrationHelper(service, log).RegisterStageConfigSteps(preImage, postImage); | ||
} | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
LinkDev.AutoNumbering.Plugins/Config/Register/PreDeleteRegisterStep.cs
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#region Imports | ||
|
||
using System; | ||
using System.Linq; | ||
using LinkDev.AutoNumbering.Plugins.Helpers; | ||
using LinkDev.Libraries.Common; | ||
using Microsoft.Xrm.Sdk; | ||
|
||
#endregion | ||
|
||
namespace LinkDev.AutoNumbering.Plugins.Config.Register | ||
{ | ||
public class PreDeleteRegisterStep : IPlugin | ||
{ | ||
public void Execute(IServiceProvider serviceProvider) | ||
{ | ||
new PreDeleteRegisterStepLogic().Execute(this, serviceProvider); | ||
} | ||
} | ||
|
||
[Log] | ||
internal class PreDeleteRegisterStepLogic : PluginLogic<PreDeleteRegisterStep> | ||
{ | ||
public PreDeleteRegisterStepLogic() : base("Delete", PluginStage.PreOperation, AutoNumbering.EntityLogicalName) | ||
{ | ||
} | ||
|
||
[NoLog] | ||
protected override void ExecuteLogic() | ||
{ | ||
var preImage = context.PreEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
var postImage = context.PostEntityImages.FirstOrDefault().Value?.ToEntity<AutoNumbering>(); | ||
new RegistrationHelper(service, log).RegisterStageConfigSteps(preImage, postImage); | ||
} | ||
} | ||
} |
Oops, something went wrong.