Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
How do I get the first node with a specific value from a list with Razor?
I've been trying with something like this;
@Model.Comments.First().Where("memberID",@member.Id).Where("Visible").Name;
Almost, let's move things around a little:
@Model.Comments.Where("Visible").Where("memberID = \"" + member.Id + "\"").First().Name;
That makes sense - it does however not work completely.
This works
Where("memberID = 1200")
This doesn't
Where("memberID = \"" + member.Id + "\"")
Ah yes sorry, I'm thinking in strings too much! ;)
So make it: Where("memberId == " + member.Id)
Oh hang on, just noticed that I did 1 equals signs, instead of 2, so my solution might still work if you put == in there instead of =.
Yes, I tried that, but it didn't work.
Where("memberID == " + member.Id)
Works perfectly well - Thanks :o)
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.
Continue discussion
get first node with specific property value
How do I get the first node with a specific value from a list with Razor?
I've been trying with something like this;
@Model.Comments.First().Where("memberID",@member.Id).Where("Visible").Name;
Almost, let's move things around a little:
That makes sense - it does however not work completely.
This works
Where("memberID = 1200")
This doesn't
Where("memberID = \"" + member.Id + "\"")
Ah yes sorry, I'm thinking in strings too much! ;)
So make it: Where("memberId == " + member.Id)
Oh hang on, just noticed that I did 1 equals signs, instead of 2, so my solution might still work if you put == in there instead of =.
Yes, I tried that, but it didn't work.
Where("memberID == " + member.Id)
Works perfectly well - Thanks :o)
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.