private static TypeInfo Find()

in src/DotPulsar/Internal/Compression/ZstdCompression.cs [79:97]


    private static TypeInfo Find(IEnumerable<TypeInfo> types, string fullName)
    {
        foreach (var type in types)
        {
            if (type.FullName is null || !type.FullName.Equals(fullName))
                continue;

            if (type.IsPublic &&
                type.IsClass &&
                !type.IsAbstract &&
                type.ImplementedInterfaces.Contains(typeof(IDisposable)) &&
                type.GetConstructor(Type.EmptyTypes) is not null)
                return type;

            break;
        }

        throw new Exception($"{fullName} as a public class with an empty public constructor and implementing IDisposable was not found");
    }