Thanks for the reply. I understand.
// C#
ExcludeIncludeFieldsList excludedFields = new ExcludeIncludeFieldsList();
excludedFields.Add(CustomerFields.ContactName);
excludedFields.Add(CustomerFields.Country);
// fetch a collection of customers.
EntityCollection<CustomerEntity> customers = new EntityCollection<CustomerEntity>();
SortExpression sorter =
new SortExpression(CustomerFields.CustomerId | SortOperator.Descending);
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntityCollection(customers, null, 0, sorter, null, excludedFields);
}
// fetch a single customer
CustomerEntity c = new CustomerEntity("CHOPS");
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchEntity(c, null, null, excludedFields);
}
// ...
// load the excluded fields into the entities already loaded:
using(DataAccessAdapter adapter = new DataAccessAdapter())
{
adapter.FetchExcludedFields(customers, excludedFields);
adapter.FetchExcludedFields(c, excludedFields);
}
' VB.NET
Dim excludedFields As New ExcludeIncludeFieldsList()
excludedFields.Add(CustomerFields.ContactName)
excludedFields.Add(CustomerFields.Country)
' fetch a collection of customers.
Dim customers As New EntityCollection(Of CustomerEntity)()
Dim sorter As New SortExpression(CustomerFields.CustomerId Or SortOperator.Descending)
Using adapter As New DataAccessAdapter()
adapter.FetchEntityCollection(customers, Nothing, 0, sorter, Nothing, excludedFields)
End Using
' fetch a single customer
Dim c As New CustomerEntity("CHOPS")
Using adapter As New DataAccessAdapter()
adapter.FetchEntity(c, Nothing, Nothing, excludedFields)
End Using