Example #1
0
        public async Task <TModel> CaptureModel(string insertCommand, Func <TModel, bool> findModelFunc)
        {
            var schemes = _schemeFactory.CreateSchemes(
                TriggerType.Insert, TriggerType.Delete, TriggerType.Update);

            _watcher.AddTriggers(schemes);
            _watcher.TableChanged += OnTableChanged;
            _watcher.StartListening();

            var sqlExecuter = _entitiesFactory.CreateMainDbSqlExecuter();

            sqlExecuter.ExecuteNonQuery(insertCommand);

            var model = await WaitForModel(TimeSpan.FromSeconds(10), findModelFunc);

            return(model);
        }
Example #2
0
 public void Start()
 {
     _watcher.StartListening();
     Logger.LogDebug("Started");
 }