public LockProcedure(string either, StartingWith type) { if (type == StartingWith.StandID) { StandID = either; UserID = ""; } else { UserID = either; StandID = ""; } IsLocked = false; DateTime = DateTime.Now; }
public TimeSpan Start() { var s = new Stopwatch(); s.Start(); foreach (var t in _tablesToCopy) { var rows = _databaseIO.GetRows(t); StartingWith?.Invoke(this, new Tuple <string, long>(t.FullTableName, rows)); _databaseIO.TimeOut = Timeout; _databaseIO.CopyTable(t); //System.Threading.Thread.Sleep(5000); // simulate long operation DoneWith?.Invoke(this, t.FullTableName); } DoneWith?.Invoke(this, null); s.Stop(); return(s.Elapsed); }
static IEnumerable <string> ByPrefix(StartingWith query, Connection <string> connection) { return(connection.List.Where(x => x.StartsWith(query.Prefix))); }