This doesn't work: List<Content> = _hive.QueryContent()
.OfRevisionType(FixedStatusTypes.Published)
.Where(x => x.Name == "My Content Name")
.ToList();
Am I doing something wrong or is this a bug? I've been searching the forums/web for help, but can't find anything. Any help would be greatly appreciated.
Trying to query hive.
I just installed the April 20 build of 5.1. I added a custom controller so that I can query the hive and pass XML data back to the caller.
This works:
List<Content> = _hive.QueryContent()
.OfRevisionType(FixedStatusTypes.Published)
.Where(x => x.ContentType.Alias == "BookPage")
.ToList();
This doesn't work:
List<Content> = _hive.QueryContent()
.OfRevisionType(FixedStatusTypes.Published)
.Where(x => x.Name == "My Content Name")
.ToList();
Am I doing something wrong or is this a bug? I've been searching the forums/web for help, but can't find anything. Any help would be greatly appreciated.
Thanks,
Jimmy
Hi Jimmy,
Querying content will return content, media, but also uers types for example, which doesn't necessarily have the "Name" attribute resulting in an exception... I've run into this myself and was able to workaround... See http://our.umbraco.org/forum/core/umbraco-5-general-discussion/30868-Check-if-node-exists
And from looking at this thread, no one has actually find a decent solution to this
Cheers,
Dirk
is working on a reply...