Page 1 of 1

Mapping Mode Property

Posted: Wed 09 Nov 2011 13:00
by luigisaggese
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?

Posted: Thu 10 Nov 2011 17:34
by StanislavK
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.

Posted: Mon 14 Nov 2011 16:41
by luigisaggese
Thanx a lot!! :D