开发者

.DBML file and LINQ to SQL

开发者 https://www.devze.com 2022-12-28 03:10 出处:网络
In my DBML file I have mapped some tables and stored procedures, and the stored procedures return type is ISingleResult . T is some mapped table. But I want to take the data into my own created entiti

In my DBML file I have mapped some tables and stored procedures, and the stored procedures return type is ISingleResult . T is some mapped table. But I want to take the data into my own created entities rather than LINQ to SQL created entites. The entites created by me are also the same as the mapped table entities and their use lies when we send data across the a web service. So , how can I proceed by creating a wrapper around the 开发者_StackOverflowDBML file so that I always get data in my own created entites.


Entity Framework is designed for this scenario, but if you cannot move to that for other reasons, Automapper is worth looking into.

You can add attributes to linq to sql entities that are not mapped to database columns, by adding a property in the designer and leaving the datasource property empty.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号