SqlServer2KCompatibilityAnnotation.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace System.Data.Linq.SqlClient {
  5. /// <summary>
  6. /// Annotation which indicates that the given node will cause a compatibility problem
  7. /// for the indicated set of providers.
  8. /// </summary>
  9. internal class SqlServerCompatibilityAnnotation : SqlNodeAnnotation {
  10. SqlProvider.ProviderMode[] providers;
  11. /// <summary>
  12. /// Constructor
  13. /// </summary>
  14. /// <param name="message">The compatibility message.</param>
  15. /// <param name="providers">The set of providers this compatibility issue applies to.</param>
  16. internal SqlServerCompatibilityAnnotation(string message, params SqlProvider.ProviderMode[] providers)
  17. : base(message) {
  18. this.providers = providers;
  19. }
  20. /// <summary>
  21. /// Returns true if this annotation applies to the specified provider.
  22. /// </summary>
  23. internal bool AppliesTo(SqlProvider.ProviderMode provider) {
  24. foreach (SqlProvider.ProviderMode p in providers) {
  25. if (p == provider) {
  26. return true;
  27. }
  28. }
  29. return false;
  30. }
  31. }
  32. }