More in this section

Forums / Bugs & Issues / content category

content category

2 posts, 0 answered
  1. Waqar
    Waqar avatar
    16 posts
    23 Nov 2010
    11 Jan 2011
    Link to this post
    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 = $ )"}

    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.

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    12 Sep 2017
    11 Jan 2011
    Link to this post
    Hi waqar,

    Please take a look at this post.

    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
2 posts, 0 answered