Created
November 18, 2013 14:46
-
-
Save ps-team/7528970 to your computer and use it in GitHub Desktop.
GetNodeByContentId
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@functions | |
{ | |
public Node GetNodeByContentId(int contentId) | |
{ | |
var myQuery = Query.Where("Property_C_ID").IsEqualTo(contentId.ToString()); | |
var nodes = new NodeFinder().Find(myQuery); | |
if (nodes.Count > 0) { | |
return nodes[0]; | |
} else { | |
return null; | |
} | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Functions | |
Function GetNodeByContentId(contentId As Integer) As Node | |
Dim myQuery = Query.Where("Property_C_ID").IsEqualTo(contentId) | |
Dim nodes = New NodeFinder().Find(myQuery, 1, selectCount:=1) | |
If nodes.Count > 0 Then | |
Return nodes(0) | |
Else | |
Return Nothing | |
End If | |
End Function | |
End Functions |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment