Ambiguous extension method

  1. Remove the ambiguity by redefining or eliminating one of the methods at the source. You don’t need redundancy.
  2. If you do not control the source, include only one of them in your class file via the using directive.
  3. If you still need both namespaces in the given class file, invoke the version you wish simply as a static class call, unambiguously identifying the method via the (potentially fully qualified) class name.
 Abc.Xyz.ExtensionsClass.NoNull(database.ExecuteScalar(), string.Empty);
 // <Abc.Xyz.> is only necessary if the classes themselves match names
 // if not, only <ClassName>.<MethodName> is needed

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)