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); }
public void Start() { _watcher.StartListening(); Logger.LogDebug("Started"); }