Devart table mapping

Discussion of open issues, suggestions and bugs regarding LinqConnect – Devart's LINQ to SQL compatible ORM
Post Reply
Lucas Phillip
Posts: 10
Joined: Wed 29 Jun 2011 14:37

Devart table mapping

Post by Lucas Phillip » Fri 22 Jul 2011 13:34

So I'm trying to create a custom Insert. I wanna pass as an argument the entity and use it to build SQL string.

Is there a way I can use Devart mapping to do that, so I don't have to do the mapping of the Table by myself?

Thanks

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

Post by StanislavK » Mon 25 Jul 2011 10:20

You can define the partial method 'Insert[Entity]', which is declared in the DataContext class generated by Entity Developer. This method accepts an entity instance, and you can prepare and execute a command that inserts this instance in the proper way.

As for the mapping metadata, you can access them via the Mapping property of the data context object. The LinqConnect mapping classes inherit from the ones defined in the System.Data.Linq.Mapping namespace, thus you can work with them in the standard way.

I've sent you a sample project in a letter, please check that it was not blocked by your mail filter.

Post Reply