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 service LoadStringedObjectView.
  • InitDataCopy — enable or disable initialization copy data when reading data.
  • LimitFunctionrestriction 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).

Application LoadingCustomizationStruct

To subtract a dataset from the database into memory, you

  1. To create an object of type ICSSoft.STORMNET.Business.LoadingCustomizationStruct
LoadingCustomizationStruct lcs = LoadingCustomizationStruct.GetSimpleStruct(тип, представление);

  1. it is possible to manually set a view
lcs.View = Клиент.Views.КлиентE;
  1. Set the type of objects deducted
lcs.LoadingTypes=new Type[) {typeof(Кредит)};
  1. To impose restrictions deducted items (if the restriction is not imposed is deducted, all objects of this type)
lcs.LimitFunction = <Объект типа ICSSoft.STORMNET.FunctionalLanguage.Function>
  1. To configure other settings for reading (optional)
  2. 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.