Hi, for some reason Field
stop working after the update to 7.1. Is there a new way to get an image by name?
And why is ID not set when an image is uploaded thru backend?
private File GetLitiumFile(string fileName)
{
using (var query = _dataService.CreateQuery<File>())
{
var items = query.Filter(x => x
.Bool(b => b
.Must(m => m.Field(SystemFieldDefinitionConstants.NameInvariantCulture, "eq", fileName))
));
var existingFile = items.FirstOrDefault();
return existingFile;
}
}
Litium version:7.1