Пример #1
0
        public void Delete(int id)
        {
            Predictor predictor = this.predictors.FirstOrDefault(p => p.Id == id);

            this.predictors.Remove(predictor);
            this.SavePredictors();
        }
Пример #2
0
        public void Add(string baseUrl, string controllerUrn, int timeoutSec)
        {
            int id = 0;

            if (this.predictors.Count > 0)
            {
                id = this.predictors.Max(p => p.Id) + 1;
            }

            Predictor predictor = new Predictor(baseUrl, controllerUrn, timeoutSec);

            predictor.Id = id;

            this.predictors.Add(predictor);
            this.SavePredictors();
        }