4.1 upgrade - Taxon querying problem
Hello, I've got following problem. In Sitefinity 4.0 I used this code to select single taxon.
var taxonomyManager = TaxonomyManager.GetManager();
var taxon = taxonomyManager
.GetTaxa<FlatTaxon>()
.Where(tx => tx.Taxonomy.Name == taxonomyName)
.Where(tx => tx.UrlName == taxonUrlName)
.SingleOrDefault();
var taxonomyManager = TaxonomyManager.GetManager();
var taxonsList = taxonomyManager
.GetTaxa<FlatTaxon>()
.Where(tx => tx.Taxonomy.Name == taxonomyName)
.ToList();
foreach
(var t
in
taxonsList)
if
(t.UrlName == taxonUrlName)
// do something
Hope, I will have not this issue because i use a lot of this type of queries for a website.
Upgrade to 4.1 is already complicated with many bugs, i don't need this one.
Jocelyn
Hello michiz,
This is very strange. Is it possible that you have been mistaken somehow? We tested with exactly the same code as you and it works fine. Can you try again? If it is still reproducible, can you send us the project so we could investigate it locally?
Regards,
Vlad
the Telerik team
Unfortunately I still use workaround solution. There is one thing, which I noticed. When selecting taxons filtered by Name I get correct results.
taxonomyManager
.GetTaxa<FlatTaxon>()
.Where(tx => tx.Name == "something")
.ToList();
Hi michiz,
We managed to reproduce the problem - it occurs in multilingual mode, however seems it is not a common LINQ issue in multilingual, because it works fine for some other queries which have Lstring properties. We will investigate the problem further and will let you know about the result.
All the best,
Vlad
the Telerik team
Thank you for response. I look forward for problem resolution.
Regards
michiz
Hi michiz,
Here is some update.
In the meantime, you can use the following alternative and better workaround:
ar taxonomyManager = TaxonomyManager.GetManager();
var taxon = taxonomyManager
.GetTaxa<FlatTaxon>()
.Where(tx => tx.Taxonomy.Name == taxonomyName)
.Where(tx => tx.UrlName[
""
] == taxonUrlName)
.SingleOrDefault();
Hello michiz,
This issue is addressed in the latest release (Sitefinity 4.1 SP1).
Best wishes,
Vlad
the Telerik team