Parameters
- query
- SQL query code.
- parameters
- Query parameters.
Type Parameters
- TResult
- The type of entity, returned by the method.
Return Value
IQueryable that represents the result of the SQL query execution.
This method executes SQL query against the database. It returns IQueryable that represents the result of the SQL query execution. This allows dalayed query result fetching and using this method calls as a subquery in LINQ to SQL queries. For example:
from c in db.Query<Company>("Select * From Company Where CompanyName LIKE {0} ", "motors") from o in db.Orders where o.CompanyId = c.CompanyId select new {c, o}
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2