Devart table mapping

Devart table mapping

Postby 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
Lucas Phillip
 
Posts: 10
Joined: Wed 29 Jun 2011 14:37

Postby 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.
StanislavK
Devart Team
 
Posts: 1710
Joined: Thu 03 Dec 2009 10:48


Return to LinqConnect (LINQ to SQL support)