示例#1
0
        public void Execute(ServerData data, SourceServerData sourceData)
        {
            var dataBases = new List<IRepository> { new ProdDB(), new QADB() };

            foreach (var dataBase in dataBases.Where(dataBase => ((IRule)dataBase).IsValid(data, sourceData)))
            {
                dataBase.Save();
            }
        }
        private bool IsValid(ServerData data, SourceServerData sourceData)
        {
            var validators = new List<IValidator>
            {
                new IPValidator(),
                new TypeValidator()
            };

            return new Validator(validators).Validate(data, sourceData);
        }
示例#3
0
        private void Migrate(ServerData data)
        {
            try
            {
                //Migrate data from server to server

                _logger.InfoFormat("Migrating data with Id:{0}", data.Id);
            }
            catch (Exception ex)
            {
                _logger.ErrorFormat("An exception occurred attempting to migrate data with Id:{0}", data.Id);

                throw;
            }
        }
示例#4
0
 public bool Validate(ServerData data, SourceServerData sourceData)
 {
     return data.Type == sourceData.Type;
 }
示例#5
0
 public bool Validate(ServerData data, SourceServerData sourceData)
 {
     return data.IP != sourceData.IP;
 }
示例#6
0
 public bool Validate(ServerData data, SourceServerData sourceData)
 {
     return _validators.Any(validator => validator.Validate(data, sourceData));
 }
示例#7
0
 public bool IsValid(ServerData data, SourceServerData sourceData)
 {
     return new Validator(new List<IValidator>()).Validate(data, sourceData);
 }
示例#8
0
 public override bool IsValid(ServerData data, SourceServerData sourceData)
 {
     return base.IsValid(data, sourceData);
 }