EntityContainer Element (CSDL)

The EntityContainer element defines a collection of entities within a single Business Intelligence data model. In an application, an EntityContainer represents a data model that might contain multiple tables with column linked by relationships, as well as calculations, measures, and KPIs.

The EntityContainer must specify each of the entity types that are included in the data model. Information about these model entities is specified by listing child entities of the type, Entity element. For more information, see EntityType Element (CSDL).

An EntityContainer element can have the following elements:

  • EntitySet element

  • AssociationSet element

Properties such as collation and language are defined at the level of the EntityContainer, not on individual objects. However, columns and text attributes within the model can have captions or translations in other languages.

Applicable Attributes

The table below describes the attributes that can be found on the EntityContainer element.

Attribute Name

Is Required

Value

Name

Yes

The name of the data model.

Caption

No

A description of the database or data model.

Culture

Yes

A string that contains the LCID of the request.

CompareOptions

Yes

Language-specific sorting and string comparison options for the model.

The CompareOptions attribute defines collation properties that are applied to the data model. The properties defined by CompareOptions are derived from settings for sort order, kana sensitivity, and case sensitivity that are set in the Analysis Services database at model design time. The following table describes the values that are included as part of the CompareOptions attribute.

Attribute Name

Is Required

Value

IgnoreCase

Yes

Boolean value that indicates whether the option has been enabled in the data model.

IgnoreNonSpace

Yes

Boolean value that indicates whether the option has been enabled in the data model.

IgnoreKanaType

Yes

Boolean value that indicates whether the sorting option has been enabled in the data model.

IgnoreWidth

Yes

Boolean value that indicates whether the sorting option has been enabled in the data model.

The following table shows the collation options from Analysis Services, and how these compare to the .NET sorting options.

Windows Sorting Style

.Net CompareOptions

Binary (_BIN) 1

Ordinal

Binary code-point (_BIN2) 1

Ordinal

Case-sensitive (_CS)

IgnoreCase

Accent-sensitive (_AS)

IgnoreNonSpace

Kana-sensitive (_KS)

IgnoreKanaType

Width-sensitive (_WS)

IgnoreWidth

Note that the following .NET settings are not supported:

  • IgnoreSymbols

  • OrdinalIgnoreCase

  • StringSort

Example

The following sample represents a simple data model containing three tables, and one relationship on the Geography key. The Culture attribute on the EntityContainer represents the language of the server.

Namespace="SimpleModel">
          <EntityContainer Name="SimpleModel">
            <EntitySet Name="DimCustomer" EntityType="SimpleModel.DimCustomer">
              <bi:EntitySet />
            </EntitySet>
            <EntitySet Name="DimDate" EntityType="SimpleModel.DimDate">
              <bi:EntitySet />
            </EntitySet>
            <EntitySet Name="DimGeography" EntityType="SimpleModel.DimGeography">
              <bi:EntitySet />
            </EntitySet>
            <AssociationSet Name="DimCustomer_DimGeography_GeographyKey" Association="SimpleModelDB.DimCustomer_DimGeography_GeographyKey">
              <End EntitySet="DimCustomer" />
              <End EntitySet="DimGeography" />
              <bi:AssociationSet />
            </AssociationSet>
            <bi:EntityContainer Culture="en-US">
              <bi:CompareOptions IgnoreCase="true" />
            </bi:EntityContainer>
          </EntityContainer>