To decrease the expensive wire transaction, load only the properties that needs to be filled up.
Use 'Include(Title,Id)' only when you want to load the properties for a collection of Objects, here 'Lists'.
You need to load the properties that you want to use, else you will receive the Not Initialized Exception.
If you do not load the properties, all of the Scalar properties of the object will be loaded by default but not the collections.
CAML Queries to get_items from list: Two ways (In-place Load and Query-able load)
No performance difference, but the Query-able load not maitain the object identity but could be more familiar for server-side programmers.
In-Place Load:
Query-able load:
Working code to read data from a different list --
Use 'Include(Title,Id)' only when you want to load the properties for a collection of Objects, here 'Lists'.
You need to load the properties that you want to use, else you will receive the Not Initialized Exception.
If you do not load the properties, all of the Scalar properties of the object will be loaded by default but not the collections.
CAML Queries to get_items from list: Two ways (In-place Load and Query-able load)
No performance difference, but the Query-able load not maitain the object identity but could be more familiar for server-side programmers.
In-Place Load:
Query-able load:
Working code to read data from a different list --
No comments:
Post a Comment