
Visual Basic (Declaration) | |
---|---|
Public Class StoredProcQuery Implements IEntityQuery, IUntypedEntityQuery, System.ICloneable |
Visual Basic (Usage) | ![]() |
---|---|
Dim instance As StoredProcQuery |
C# | |
---|---|
public class StoredProcQuery : IEntityQuery, IUntypedEntityQuery, System.ICloneable |
C++/CLI | |
---|---|
public ref class StoredProcQuery : public IEntityQuery, IUntypedEntityQuery, System.ICloneable |
C# | ![]() |
---|---|
// Sample 1 - Directly calling the generated method on your sub-typed EntityManager. private void Sample1() { IdeaBladeTutorial.Manager mgr = new IdeaBladeTutorial.Manager(); DateTime dt1 = DateTime.Parse("1/1/1990"); DateTime dt2 = DateTime.Parse("1/1/2000"); var results = mgr.GetSalesByYear(dt1, dt2); } // Sample 2 - Getting the StoredProcQuery from the generated method. private void Sample2() { IdeaBladeTutorial.Manager mgr = new IdeaBladeTutorial.Manager(); DateTime dt1 = DateTime.Parse("1/1/1990"); DateTime dt2 = DateTime.Parse("1/1/2000"); StoredProcQuery query = mgr.GetSalesByYearQuery(dt1, dt2); var results = mgr.ExecuteQuery<SalesByYear>(query); } |
The DevForce Object Mapper auto-generates two functions on the sub-typed EntityManager in your Domain Model for every stored procedure you've imported: the first returns a StoredProcQuery for the named procedure, and the second builds and executes a StoredProcQuery from the parameters provided and returns the results. To execute the StoredProcQuery returned by the first function mentioned, use EntityManager.ExecuteQuery or one of the available overloads.
These queries always use a FetchStrategy of DataSourceOnly, and cannot be used when disconnected from the EntityServer.
You must have already defined a FunctionImport in your Entity Domain Model in order to use the StoredProcQuery; you may not execute a stored procedure defined in your database but unknown to your model.
Note: Stored procedures returning primitive data types are not currently supported, therefore the ElementType must always be an Entity.
System.Object
IdeaBlade.EntityModel.StoredProcQuery
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family