/// <summary> /// Prepare serializers for all TL objects in an assembly. /// For all objects with TLObject attribute should be prepared a serializer. /// </summary> /// <param name="assembly">Assembly with TL objects.</param> public void PrepareSerializersForAllTLObjectsInAssembly(Assembly assembly) { foreach (TypeInfo typeInfo in assembly.DefinedTypes.Where(typeInfo => typeInfo.GetCustomAttribute <TLObjectAttribute>() != null)) { _serializersBucket.PrepareSerializer(typeInfo.AsType()); } }
/// <summary> /// Prepare serializer for an object type. /// </summary> /// <typeparam name="T">Type of an object.</typeparam> public void PrepareSerializer <T>() { _serializersBucket.PrepareSerializer <T>(); }