Could please explain your requirement. Do you want to add an attachment to a data class?
Attachments are mapped by the Link-Attachment class, so it is technically possible to add an attachment to a data class but the problem is there is not existing places where this is done. You might have to use filePath control to upload the file and create an instance of Data-WorkAttachFile and use Link-Objects method to create the link- instance.
You can refer to Work- AttchFile activity for the implementation details