Available Output Settings

The following settings are available for Linq to Sql. There are two sections, one for the global defaults, which you can edit in the Project Settings Editor of the designer, and one which discusses the settings available per element, and which default setting sets their default value. This way you can easily track which default to set for which element setting.

Defaults

The following default settings and attributes are available, which control the default value for settings available per element.

Settings

These settings are edited using the Project Properties Editor, Output Setting Values tab.

EntityBaseClassNameDefault

This setting specifies the default value for the EntityBaseClassName setting of an entity. Default value: empty string

EmitKnownTypeAttributesForWCFDefault

This setting specifies the default value for the EmitKnownTypeAttributesForWCF setting of an entity. Default value: false

TypedListRowBaseClassNameDefault

This setting specifies the default value for the TypedListRowBaseClassName setting of a typed list. Default value: empty string

TypedViewRowBaseClassNameDefault

This setting specifies the default value for the TypedViewRowBaseClassName setting of a typed view. Default value: empty string

Element Settings

The following settings are available per element. These settings are edited on the element's own editor (or the containing element's editor, in the case where the element itself doesn't have a separate editor) on the Code-gen info tab, or on the Project Settings Editor, if the element is the project.

Entity definition settings

EntityBaseClassName

The name of the base class for a generated entity class. The following macros are available: {$Name} for the entity name without group name, {$GroupName} for the name of the group the entity is in, {$FullName} for the group name plus entity name. Sub-types will always inherit from their super-type and not from the class specified. Default value: the value of the default EntityBaseClassNameDefault.

EmitKnownTypeAttributesForWCF

This setting controls whether the code generator will add KnownType attributes to the generated entity classes for all types used in the class (true) or not (false, default). KnownTypeAttribute is used for WCF serialization and should be used in combination with Data Contracts. Default value: the value of the default EmitKnownTypeAttributesForWCFDefault

Entity Field Settings

GenerateAsIsDbGenerated.
When set to true, the field will be marked as IsDbGenerated and the value is considered to be generated by the database. Default is false. Fields which have a sequence specified or are mapped onto a computed field already are marked as IsDbGenerated.

Project settings

PublicPropertyGettersAndSetters

This setting controls whether the generated entity, typed view and typed list classes have public getters and setters for properties, like the properties for entity fields. If set to false, the properties will be generated as private for entity and typed view classes and internal for typed list classes. The context class will always have public properties. Default value: true

MappingsAsExternalXmlFile

This setting controls whether the mapping information for the various elements (entities, typed views, stored procedures) is generated into a separate XML file (true) or as attributes inside the generated code (false) Default value: true

PreferBinaryTypeOverByteArray

This setting controls whether the preferred type for binary types is 'System.Data.Linq.Binary' (true) or a byte array (false). System.Data.Linq.Binary has an advantage at runtime for change tracking and is therefore recommended. Default value: true

Typed List definition settings

TypedListRowBaseClassName

The name of the base class for a generated typed list class. The following macros are available: {$Name} for the typed list name without group name, {$GroupName} for the name of the group the typed list is in, {$FullName} for the group name plus typed list name. Default value: the value of the default TypedListRowBaseClassNameDefault

Typed View definition settings

TypedViewRowBaseClassName

The name of the base class for a generated typed view class. The following macros are available: {$Name} for the typed view name without group name, {$GroupName} for the name of the group the typed view is in, {$FullName} for the group name plus typed view name. Default value: the value of the default TypedViewRowBaseClassNameDefault