content category
Hello!
I am having two categories with the name to Exterior and Interior and I wrote following code to get contents inside the category.
var taxonomyManager = TaxonomyManager.GetManager();
var c = "categories";
var taxonomy1 = taxonomyManager.GetTaxonomies<HierarchicalTaxonomy>().Where(t => t.Name == c).SingleOrDefault();
var b = taxonomy1.Taxa.Where(t => t.Name == "Interior").SingleOrDefault();
var contents = App.WorkWith().ContentItems().Where(ci => ((IList<Guid>)ci.GetValue("Category")).Contains(b.Id)).Get();
contents.Count();///***** Here the error occurs******////
threw an exception of type
'Telerik.OpenAccess.Exceptions.QueryException'
base
Telerik.OpenAccess.OpenAccessException: "line 1:173: expecting
\"TOK_UNSIGNED_INTEGER\", found '2.' (\"2.\" is a reserved word.)\r\nOriginal
Query: DEFINE EXTENT extnt FOR
Telerik.Sitefinity.GenericContent.Model.ContentItem; SELECT COUNT(*) FROM extnt
AS t1 WHERE t1.appName = $1 AND EXISTS x IN t1.Category : ( x = $2.id )"
Please let me that is it a kind of bug or any thing wrong from my side. Please reply ASAP.
and also suggest how can I do this task.
Thanks!
Hi waqar,
Please take a look at this post.
Regards,
Ivan Dimitrov
the Telerik team