예제 #1
0
        public void CreateWatcherOption(int id, string filter, string includeSubDirectories, string enableRaisingEvents)
        {
            var watcherModel = new WatcherModel {
                Id = id, Filter = filter, IncludeSubdirectories = includeSubDirectories, EnableRaisingEvents = enableRaisingEvents
            };

            _watcherContext.WatcherOptions.Add(watcherModel);
            _watcherContext.SaveChanges();
        }
예제 #2
0
        private async Task Work()
        {
            //make error to test hub client
            var model = new WatcherModel();

            if (i == 3)
            {
                model.StartTime = DateTime.Now;
                model.Error     = true;
                model.ErrorTime = DateTime.Now;
                model.Message   = "Test error";
                i = 0;
            }
            else
            {
                model.StartTime = DateTime.Now;
                model.Message   = "Work";
                i++;
            }
            await Hub.Clients.All.WatcherStatus(model);
        }