public static IEnumerable <TEdge> GetInEdges <TVertex, TEdge>(this IBidirectionalGraph <TVertex, TEdge> graph, TVertex vertex) where TEdge : IEdge <TVertex> { var result = new List <TEdge>(); IEnumerable <TEdge> edges; graph.TryGetInEdges(vertex, out edges); if (edges != null) { result.AddRange(edges); } return(result); }