I'm trying to query a folder under the media library which has a bunch of templates based on a custom File template. I've tried to play around with a couple approaches but none of them have been successful.
I have tried:
1) Querying the entire media folder and grabbing all files based on the File template using the following line:
var files = SitecoreContext.Database.SelectItems($"fast:/sitecore/media library/*#[@@id = '{dcdFilesFolderId}']#//**#[@@tid = '{templateId}']#");
but this results in the error:
Sitecore.Data.Query.ParseException: End of string expected at position 77.
2) Query for a single item using the file ID:
var file = SitecoreContext.Database.SelectItem(
$"fast:/sitecore/media library/*#[@@id = '{dcdFilesFolderId}']#//**[@File ID = '{fileid}']");
and this returns no hits.
What else can I try or make these queries work?