content category

Posted by Community Admin on 04-Aug-2018 14:17

content category

All Replies

Posted by Community Admin on 11-Jan-2011 00:00

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!

Posted by Community Admin on 11-Jan-2011 00:00

Hi waqar,

Please take a look at this post.

Regards,
Ivan Dimitrov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

This thread is closed