public List <Input> GetChangesWithDependencies <Input>(IEnumerable <Input> inputs) where Input : IInput { var res = new List <Input>(); foreach (var input in inputs) { string lastProperties; if (!_lastCache.InputCache.TryGetValue(input.Key, out lastProperties) || _currentCache.InputCache[input.Key] != lastProperties) { res.Add(input); res.AddRange(DG.GetDependencyFrom(input).OfType <Input>()); } } return(res); }