Find items from the repository based on a sql condition

Namespace: DotNetNuke.Data
Assembly: DotNetNuke (in DotNetNuke.dll)

Syntax

C#
IEnumerable<T> Find(
	string sqlCondition,
	params Object[] args
)
Visual Basic
Function Find ( 
	sqlCondition As String,
	ParamArray args As Object()
) As IEnumerable(Of T)

Parameters

sqlCondition
Type: System..::..String
The sql condition e.g. "WHERE ArticleId = @0"
args
Type: array<System..::..Object>[]()[][]
A collection of arguments to be mapped to the tokens in the sqlCondition

Return Value

A list of items

Remarks

Find supports both full SQL statements such as "SELECT * FROM table WHERE ..." as well as a SQL condition like "WHERE ..."

Examples

Find("where ArticleId = @0 and UserId = @1", articleId, userId)

See Also