public static IWatcherUnitOfWork CreateUnitOfWork(string info = "") { var options = new DbContextOptionsBuilder <WatcherContext>().UseSqlServer(info).Options; WatcherContext context = new WatcherContext(options); IFileWatcherRepository repository = new WatcherRepository(context); return(new WatcherUnitOfWork(repository)); }
public WatcherRepository(WatcherContext watcherContext) { WatcherContext = watcherContext ?? throw new ArgumentNullException(nameof(watcherContext)); _locker = new ReaderWriterLockSlim(); }