protected virtual bool DeleteFunction(string key)
        {
            var existingFunction = FindFunction(key);

            if (existingFunction == null)
            {
                throw new ArgumentException($"Function having key {key} not found.");
            }

            return(TelemetryFunctions.Remove(existingFunction));
        }
        protected virtual bool SaveFunction(IFunction function)
        {
            var functionsBuffer = TelemetryFunctions.ToList();

            functionsBuffer.Add(function);

            if (!FunctionsListIsValid(functionsBuffer))
            {
                return(false);
            }

            DeleteFunction(function);

            TelemetryFunctions.Add(function);

            return(true);
        }
 protected virtual IList <IFunction> GetFunctions()
 {
     return(TelemetryFunctions.ToList());
 }
 protected virtual IFunction GetFunction(string name)
 {
     return(TelemetryFunctions.FirstOrDefault(f => f.Name == name));
 }