setup data sampling LoadingCustomizationStruct, data types, representation, limit, page load
LoadingCustomizationStruct
is a class Flexberry ORM to specify options for data selection (including the limit) that implements a private API, in contrast to the alternative option on the basis of LINQ. LoadingCustomizationStruct
allows you to fully customize the settings of data service for read operations of data objects.
It is convenient to create a structure LoadingCustomizationStruct
using the static method GetSimpleStruct
.
LoadingCustomizationStruct lcs = LoadingCustomizationStruct.GetSimpleStruct(typeof(Шапка), "Chapchae");
Parameters LoadingCustomizationStruct
LoadingCustomizationStruct
allows you to configure the following reading options:
View
— specifies a view, which will be performed чтение;ReturnTop
— specify the number of returned записей;LoadingTypes
— specifies the data classes whose instances you want to read (example);ColumnsSort
— collation return результатов;ColumnsOrder
— order properties of the data object in the result string with delimiters, true if the read method is used data serviceLoadStringedObjectView
.InitDataCopy
— enable or disable initialization copy data when reading data.LimitFunction
— restriction on read data objects, server will return only those objects that satisfy the given ограничению;Distinct
— obtaining of various data (used for example with the method LoadRawValues SQLDataService).LoadingBufferSize
— serving size when batch reading;RowNumber
— the range of indexes of downloadable objects,lcs.RowNumber = new RowNumberDef(2, 5);
(useful, for example, for paging).
Note: Presentation and restriction:
View
Submission must contain all the properties that are used to limit LimitFunction
, to avoid errors or incorrect account. If there is a need to expand a view in accordance with the restriction feature LimitFunction
, you can use a special class ViewPropertyAppender.Application LoadingCustomizationStruct
To subtract a dataset from the database into memory, you
- To create an object of type ICSSoft.STORMNET.Business.LoadingCustomizationStruct
LoadingCustomizationStruct lcs = LoadingCustomizationStruct.GetSimpleStruct(тип, представление);
- it is possible to manually set a view
lcs.View = Клиент.Views.КлиентE;
- Set the type of objects deducted
lcs.LoadingTypes=new Type[) {typeof(Кредит)};
- To impose restrictions deducted items (if the restriction is not imposed is deducted, all objects of this type)
lcs.LimitFunction = <Объект типа ICSSoft.STORMNET.FunctionalLanguage.Function>
- To configure other settings for reading (optional)
- To make a request to the server, using the method of
LoadObjects
data service
var credits = DataServiceProvider.DataService.LoadObjects(lcs).Cast<Кредит>();
Example
An example of using LoadingCustomizationStruct
available at: https://github.com/Flexberry/FlexberryORM-DemoApp/blob/master/FlexberryORM/CDLIB/CDADMTEST/Form1.cs.