Skip to end of metadata
Go to start of metadata

With Crosslight Entity Designer Extensions, you can generate entity services and controllers that comply with ASP.NET Web API. To learn how to create entity services, see Creating Entity Model and Services with Crosslight Entity Designer Extensions.

Accessing these entity services is similar with accessing any REST services. You can learn how to access other REST service from the following topics.

If you are using Crosslight App Framework, it is recommended to use EntityRepository to access the entity services. To learn more about entity repository, see Repository Pattern.

By default, the entity services generated by Entity Designer Extensions already support OData query. You can embed the OData query in your RestRequest, or use QueryDescriptor to generate the OData query. To learn more about the QueryDescriptor, see OData Support Using Query Descriptor.

To learn more about OData query, see http://www.odata.org/documentation/odata-version-2-0/uri-conventions/

On this page:

Sorting Data

Sorting data can be done by providing $order_by=[ column name ]. Or simply use QueryDescriptor.SortDescriptors collection.

The following code shows how to perform data sorting from an entity service.

Filtering Data

Filtering data can be done by providing $filter=[ filter expression ]. Or simply use QueryDescriptor.FilterDescriptors collection.

The following code shows how to perform data filtering from an entity service.

Paging Data

Paging data can be done by providing $skip=[ page index * page size ] and $top=[ page size]. Or simple use QueryDescriptor.PageDescriptor.

You also need to include $inlinecount=allpages to return total item count.

The following code shows how to perform data paging from an entity service.

Include Entity

Including an entity can be done by providing $expand = [ navigation property ]. Or simply use QueryDescriptor.Includes collection.

The following code shows how to include an entity relation when retrieving data from an entity service.