You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for building this framework, appreciate the effort and good thinking.
I have a question regarding Auditing ability shown in this article.
I presume that I need the ICommandingDependencyResolverAdapter resolver or ICommandRegistry registry so I can add the Pre, Post and Execute Dispatch hooks. Is there a way that I can do it in FunctionAppConfiguration currently?
Thanks!
The text was updated successfully, but these errors were encountered:
Thanks! I hadn't even seen this functionality in the commanding library!
So I dug around the repos and tested this on my example, seems to work:
using FunctionMonkey.Abstractions;
using AzureFromTheTrenches.Commanding;
public class Configuration : IFunctionAppConfiguration, ICommandingConfigurator
{
...
public ICommandRegistry AddCommanding(ICommandingDependencyResolverAdapter dependencyResolver)
{
var registry = dependencyResolver.AddCommanding();
var auditRootOnly = false;
dependencyResolver
.AddPreDispatchCommandingAuditor<ConsoleAuditor>(auditRootOnly)
.AddPostDispatchCommandingAuditor<ConsoleAuditor>(auditRootOnly)
.AddExecutionCommandingAuditor<ConsoleAuditor>(auditRootOnly);
return registry;
}
}
The key here is the Runtime.cs looks to see if your configuration is ICommandingConfigurator and runs the method. If not, it just runs the AddCommanding() extension on the resolver. Also, it throws an error if you don't run the AddCommanding before adding the auditor. The Add... extensions are in the AzureFromTheTrenches.Commanding namespace.
Hi James
Thanks for building this framework, appreciate the effort and good thinking.
I have a question regarding Auditing ability shown in this article.
I presume that I need the ICommandingDependencyResolverAdapter resolver or ICommandRegistry registry so I can add the Pre, Post and Execute Dispatch hooks. Is there a way that I can do it in FunctionAppConfiguration currently?
Thanks!
The text was updated successfully, but these errors were encountered: