1
0

Program.cs 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // Licensed to the .NET Foundation under one or more agreements.
  2. // The .NET Foundation licenses this file to you under the Apache 2.0 License.
  3. // See the LICENSE file in the project root for more information.
  4. using System;
  5. using System.Linq;
  6. using System.Reactive.Linq;
  7. using System.Reflection;
  8. namespace ApiCompare
  9. {
  10. class Program
  11. {
  12. static void Main()
  13. {
  14. var observable = typeof(Observable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  15. var asyncObservable = typeof(AsyncObservable).GetMethods(BindingFlags.Public | BindingFlags.Static).Select(m => m.Name).Distinct();
  16. var exclude = new[]
  17. {
  18. "AsObservable", // Trivially renamed to AsAsyncObservable.
  19. "FirstAsync", // Renamed to drop the Async suffix.
  20. "FirstOrDefaultAsync", // Renamed to drop the Async suffix.
  21. "LastAsync", // Renamed to drop the Async suffix.
  22. "LastOrDefaultAsync", // Renamed to drop the Async suffix.
  23. "SingleAsync", // Renamed to drop the Async suffix.
  24. "SingleOrDefaultAsync", // Renamed to drop the Async suffix.
  25. };
  26. var missing = observable.Except(exclude).Except(asyncObservable).OrderBy(m => m);
  27. foreach (var m in missing)
  28. {
  29. Console.WriteLine(m);
  30. }
  31. Console.WriteLine();
  32. Console.WriteLine("Count = " + missing.Count());
  33. }
  34. }
  35. }