Mapping Mode Property

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
luigisaggese
Posts: 17
Joined: Fri 04 Nov 2011 16:43
Location: Italia

Mapping Mode Property

Post by luigisaggese » Wed 09 Nov 2011 13:00

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?

StanislavK
Devart Team
Posts: 1710
Joined: Thu 03 Dec 2009 10:48

Post by StanislavK » Thu 10 Nov 2011 17:34

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.

luigisaggese
Posts: 17
Joined: Fri 04 Nov 2011 16:43
Location: Italia

Post by luigisaggese » Mon 14 Nov 2011 16:41

Thanx a lot!! :D

Post Reply