Esempio n. 1
0
        public virtual void AssignStrategies(IEntity entity)
        {
            if (entity != null)
            {
                // Assign an activation strategy
                entity.Activator = ActivateStrategy.New(entity);

                // Assign a validation strategy
                entity.Validator = ValidateStrategy.New(entity);
            }
        }
Esempio n. 2
0
        public void CheckStrategies(IEntity entity)
        {
            if (entity.Validator == null)
            {
                entity.Validator = ValidateStrategy.New(entity);
            }

            if (entity.Activator == null)
            {
                entity.Activator = ActivateStrategy.New(entity);
            }
        }
 public virtual void AssignValidator(IEntity entity)
 {
     // Assign a validation strategy
     entity.Validator = ValidateStrategy.New(entity);
 }