Ejemplo n.º 1
0
 public void DefaultPolicyViolationHandlerIs <TPolicyViolationHandler>(Func <TPolicyViolationHandler> policyViolationHandler) where TPolicyViolationHandler : class, IPolicyViolationHandler
 {
     RemoveDefaultPolicyViolationHandlerConventions();
     Advanced.Conventions(conventions =>
                          conventions.Add(new DefaultPolicyViolationHandlerIsInstanceConvention <TPolicyViolationHandler>(policyViolationHandler))
                          );
 }
Ejemplo n.º 2
0
 public void DefaultPolicyViolationHandlerIs <TPolicyViolationHandler>() where TPolicyViolationHandler : class, IPolicyViolationHandler
 {
     RemoveDefaultPolicyViolationHandlerConventions();
     Advanced.Conventions(conventions =>
                          conventions.Add(new DefaultPolicyViolationHandlerIsOfTypeConvention <TPolicyViolationHandler>())
                          );
 }
Ejemplo n.º 3
0
 private void RemoveDefaultPolicyViolationHandlerConventions()
 {
     Advanced.Conventions(conventions =>
     {
         conventions.RemoveAll(c => c is FindDefaultPolicyViolationHandlerByNameConvention);
         conventions.RemoveAll(c => c.IsMatchForGenericType(typeof(DefaultPolicyViolationHandlerIsOfTypeConvention <>)));
         conventions.RemoveAll(c => c.IsMatchForGenericType(typeof(DefaultPolicyViolationHandlerIsInstanceConvention <>)));
     });
 }