//
        // 摘要:
        //     使用指定的 System.Collections.Generic.IEqualityComparer<T> 对两个序列的元素进行比较,以确定序列是否相等。
        //
        // 参数:
        //   first:
        //     一个用于比较 second 的 System.Collections.Generic.IEnumerable<T>。
        //
        //   second:
        //     一个 System.Collections.Generic.IEnumerable<T>,用于与第一个序列进行比较。
        //
        //   comparer:
        //     一个用于比较元素的 System.Collections.Generic.IEqualityComparer<T>。
        //
        // 类型参数:
        //   TSource:
        //     输入序列中的元素的类型。
        //
        // 返回结果:
        //     如果根据 comparer,两个源序列的长度相等,且其相应元素相等,则为 true;否则为 false。
        //
        // 异常:
        //   System.ArgumentNullException:
        //     first 或 second 为 null。
        public static bool SequenceEqual<TSource>(this IEnumerable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer);这个方法的三个参数都是TSource,你传入的两个前面两个TSource为string,第三个TSource为List<string>

解决方案 »

  1.   

    // 返回结果:
            //     如果根据 comparer,两个源序列的长度相等,且其相应元素相等,则为 true;否则为 false。
            //根据返回说明,你根本不需要IEqualityComparer参数
      

  2.   


    前两个参数list1, list2都是List<string>啊,不是string啊
      

  3.   

    请注意对比请求参数
    this IEnumerable<TSource> first, IEnumerable<TSource> second, IEqualityComparer<TSource> comparer
    //与你的对比
    List<string>,List<string>,IEqualityComparer<List<string>> TSource     TSource    TSource
    string          string         List~string
      

  4.   

    IEnumerable<TSource>
    List<string>
    请求参数是IEnumerable,对应List
      

  5.   

    IEnumerable本身就是List,List内的类型才是你需要告诉它的
      

  6.   

    List<List<string>> 才可以
      

  7.   

     List<string> list1 = new List<string>() { "1", "2", "3" };
                list1 = (from p in list1 orderby p descending select p).ToList();
                List<string> list2 = new List<string>() { "1", "3", "2" };
                list2 = (from p in list2 orderby p descending select p).ToList();
                bool b = list1.SequenceEqual(list2);