/// <summary> /// Find all extensions with the given uri. /// </summary> /// <param name="extendable"></param> /// <param name="uri"></param> /// <returns>The list of extensions with a matching uri, or empty list if none were found.</returns> public static IEnumerable <Extension> GetExtensions(this IExtendable extendable, string uri) { return(extendable.AllExtensions().Where(ext => ext.Url == uri)); }
/// <summary> /// Return the first extension with the given uri, or null if none was found /// </summary> /// <param name="extendable"></param> /// <param name="uri"></param> /// <returns>The first uri, or null if no extension with the given uri was found.</returns> public static Extension GetExtension(this IExtendable extendable, string uri) { return(extendable.AllExtensions().FirstOrDefault(ext => ext.Url == uri)); }