EntityDAC

Range Variables, References And Collections

Declaration and initialization of a range variable that defines an initial sequence for a LINQ query

Declaration:

var
  range-variable: IMetaDataExpression;

Initialization:

meta-type-name = string value
  
range-variable := data-context.Types[meta-type-name]
| range-variable := data-context[meta-type-name]

Sample:

  var
    Emp,
    Dept: IMetaDataExpression;
  begin
    Emp  := DataContext.Types['Emp'];
    Dept := DataContext['Dept'];
  end;

Accessing entity attributes in a query

attribute-name = string value
  
entity-attribute ::=
    range-variable.Attribute[attribute-name]
  | range-variable[attribute-name]

Sample:

  Emp.Attribute['EmpNo']
  Dept['DeptNo']

Accessing a linked entity and its attributes

reference-name = string value
  
reference ::=
    range-variable.Reference[reference-name]
  
reference-attribute ::=
    reference.Attribute[attribute-name]
  | reference[attribute-name]

Sample:

  Emp.Reference['Dept']
  Emp.Reference['Dept'].Attribute['DeptNo']
  Emp.Reference['Dept']['DeptNo']

Accessing a linked entity collection and attributes of a separate entity in the collection

  
collection-name = string value
  
collection ::=
  range-variable.Collection[collection-name]
 
collection-entity-attribute ::=
    collection.Rowtype.Attribute[attribute-name]
  | collection.Rowtype[attribute-name]

Sample:

  Dept.Collection['Emps']
  Dept.Collection['Emps'].Rowtype.Attribute['DeptNo']
  Dept.Collection['Emps'].Rowtype['DeptNo']
© 1997-2017 Devart. All Rights Reserved. Request Support DAC Forum Provide Feedback