Program.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. "FirstAsync", // Renamed to drop the Async suffix.
  19. "FirstOrDefaultAsync", // Renamed to drop the Async suffix.
  20. "LastAsync", // Renamed to drop the Async suffix.
  21. "LastOrDefaultAsync", // Renamed to drop the Async suffix.
  22. "SingleAsync", // Renamed to drop the Async suffix.
  23. "SingleOrDefaultAsync", // Renamed to drop the Async suffix.
  24. };
  25. var missing = observable.Except(exclude).Except(asyncObservable).OrderBy(m => m);
  26. foreach (var m in missing)
  27. {
  28. Console.WriteLine(m);
  29. }
  30. Console.WriteLine();
  31. Console.WriteLine("Count = " + missing.Count());
  32. }
  33. }
  34. }