Can you query the description is a linq statement?
I am trying to fire off this linq but getting an error and im guessing its because GetDescription is a function rather than a variable.. Is there an alternate way if i am doing it wrong?
It almost got me there but NHibernate was throwing a nasty error when i tried adding contains but i found another of your replies where you used the count and selected the results! I think im picking up new things on the linq side of things as i only use it for basic stuff most of the time.
I'll add a link to that post if i can find it again.
Can you query the description is a linq statement?
I am trying to fire off this linq but getting an error and im guessing its because GetDescription is a function rather than a variable.. Is there an alternate way if i am doing it wrong?
string searchVal = "test";
var results = Product.All().Where(p => p.DisplayOnSite == true && p.ParentProductId == null && (p.Name.Contains(searchVal) || p.GetDescription("en-us").DisplayName.Contains(searchVal)));
The contains() part wors if i just use name but it doesnt like GetDescription.
Sorry that should say display name or description in a linq statement!
Now 5 is binned can we get the Edit fixed on first post? :)
You can do p.ProductDescriptions.Single(x => x.CultureCode == "en-us")
Thanks Soren.
It almost got me there but NHibernate was throwing a nasty error when i tried adding contains but i found another of your replies where you used the count and selected the results! I think im picking up new things on the linq side of things as i only use it for basic stuff most of the time.
I'll add a link to that post if i can find it again.
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.