Hi,
i want an information about Model Settings, specifically about Mapping Mode properties.
In my web application, i don't need to change Xml file at runtime.
In which scenario is better use Attributes than File?
Mapping Mode Property
-
- Devart Team
- Posts: 1710
- Joined: Thu 03 Dec 2009 10:48
The main advantages of using the file mapping mode are:
- you can use different mappings (e.g., the ones to servers of different DBMSs) with the same DataContext type;
- the entity classes may be generated ignorant of LinqConnect (for example, check the code generated by the POCO template).
If these features are not critical for your task, we recommend you to use the attribute mapping for the following reasons:
- it is more visual and in some sense simpler (e.g., you don't need to explicitly create a MappingSource object);
- it is static (and thus the same for each DataContext instance of the particular type), thus giving some performance gain.
Feel free to contact us if anything is unclear.
- you can use different mappings (e.g., the ones to servers of different DBMSs) with the same DataContext type;
- the entity classes may be generated ignorant of LinqConnect (for example, check the code generated by the POCO template).
If these features are not critical for your task, we recommend you to use the attribute mapping for the following reasons:
- it is more visual and in some sense simpler (e.g., you don't need to explicitly create a MappingSource object);
- it is static (and thus the same for each DataContext instance of the particular type), thus giving some performance gain.
Feel free to contact us if anything is unclear.