Using a Contact Record as an Example
The type of file is typically a Word doc, PDF, xls, etc. You need to create an attachment and set its Parent ID to the ID of the Salesforce object that you are linking it to. Be aware the attachment body needs to be a byte array. Please Google converting different types of documents to a byte array using C#
ContactService contactService = new ContactService(salesforceSession); //This is the Id for a contact directly from the browsers address bar Id contactId = new Id("00390000001TjMHAA0"); Contact contact = contactService.GetByEntityId(contactId, new SObjectField[] {Contact.Fields.Id, Contact.Fields.FirstName, Contact.Fields.LastName}); Assert.IsNotNull(contact); Assert.AreEqual(contactId, contact.Id);