What is the difference between Query and Invoke in ria services?
What is the exact difference between [Query] and [In开发者_如何学JAVAvoke] in Ria services?
You add methods to a domain service that perform the data operation you want to expose. For example, you can add methods that perform the following operations:
- Query
- Update
- Insert
- Delete
Query methods return either a single Entity object, an IQueryable object, or an IEnumerable object.
In addition, you can add the following more complicated operations:
- Invoke – operations that need to be executed without tracking or deferred execution. Used only with non-entity data, and used only when query, update, insert, or delete operations cannot be used instead.
- Named Update – custom operations that do not fall into simple modification operations
Invoke operations provide an out-of-band mechanism for returning non-entity data and executing operations with side-effects. For more information about side-effects, see the HasSideEffects property. Invoke operations are usually not appropriate for query methods. Even when an invoke operation returns an entity, the entity is generated for the client project only if it is returned by a query method.
This was gathered from here.
Hope this helps.
精彩评论