+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / Unable to resolve value of type 'ConstantIndicationT' to query node

Unable to resolve value of type 'ConstantIndicationT' to query node

2 posts, 0 answered
  1. Gary
    Gary avatar
    91 posts
    Registered:
    19 Jul 2007
    11 Mar 2013
    Link to this post

    I am receiving the error described in the title when executing the following line:

    var schoolTaxon = taxonomyManager.GetTaxa<HierarchicalTaxon>().Where(t =>
        t.Taxonomy.Id == Constants.TeacherClassesTaxonomyGuid
        && t.Name == schoolId.ToString()).SingleOrDefault();

    Any ideas? Searching Google for ConstantIndicationT yields no results.

  2. Jonathan
    Jonathan avatar
    9 posts
    Registered:
    09 Apr 2013
    24 Sep 2013 in reply to Gary
    Link to this post
    I know this is a bit old, but for others (hopefully)

    I have had the same error in Linq queries that produce an IQueryable. In my case, it's because I'm doing comparisons between 2 fields that do not match in type between how they are stored in the database (and must be referenced when an IQueryable) and how they are deserialized into objects (and must be referenced when an IEnumerable). For example, the following fails:

    var committeeName = item.GetValue<Lstring>("Title");
    var myCollection = DynamicModuleManager.GetDataItems(committeeServiceType).Where(i => i.GetValue<
    string>("CommitteeLookup") == committeeName);
    if (myCollection.Any()) <=========== FAILS HERE
    {
      logic here
    }

    but the following succeeds:

    string committeeName = item.GetValue<Lstring>("Title"); <==== note difference
    var myCollection = DynamicModuleManager.GetDataItems(committeeServiceType).Where(i => i.GetValue<
    string>("CommitteeLookup") == committeeName);
    if (myCollection.Any())
    {
      logic here
    }

    I believe this is because the "var" in the first is of type "LString", which is how the field is deserialized when converted into an object (IEnumerable, such as in .Any()), but when it carries out the database query (IQueryable) it has to be the same type as what is stored in the db ("string").

    I suspect in your example, it's a similar difference between the "Guid" type that exists on enumeration versus the "string" type that is actually used to store the Id in the db.
2 posts, 0 answered