Hey guys i am trying to get attachment Id in a subquery via the rest api in c# here is my query:
SELECT Id, Name, First_Name__c, Middle_Name__c, Last_Name__c, (SELECT Id FROM Attachments WHERE Name = 'ProfileImage.png' Limit 1) FROM Student_Bio__c
I execute the query this way:
var results = await client.QueryAsync<StudentBio>(qry);
The query runs fine but i am not getting my attachment data back in my StudentBio object. My student bio object looks like this (some fields removed to keep it small):
public class StudentBio
{
/// <summary>
/// The name of the Salesforce Object this class represents
/// </summary>
public const string SObjectTypeName = "Student_Bio__c";
/// <summary>
/// The API name of the Salesforce Object this class represents
/// </summary>
public const string ApiSObjectTypeName = "Student_Bio__c";
public string Id { get; set; }
public string Name { get; set; }
public Attachments Attachments { get; set; }
}
public class Attachments
{
public RootObject[] Attachment { get; set; }
}
public class RootObject
{
public string Id { get; set; }
}
when the query runs I get no errors but the value of StudentBio.Attachments is null when I expect to see one record
Here is an image of the object showing the null value