开发者

Is it possible to use LINQ to SQL with Oracle?

开发者 https://www.devze.com 2023-04-02 06:23 出处:网络
I need to develop a program that must delete and insert data into an Oracle database. Is it possible to use LINQ to SQL with Oracle?

I need to develop a program that must delete and insert data into an Oracle database. Is it possible to use LINQ to SQL with Oracle?

For development I use MS SQL server but it will be a Oracle database开发者_开发技巧 in production. What do you recommend?


Officially No. Linq to SQL was originally build with the ability to swap out the data provider to allow connections to other databases, but they disabled this functionality in the released versions to encourage people to use more stable and supported data access layers (like EF). The recommended approach is to use Entity Framework if you want to switch between SQL and Oracle.

Also, Patrick is very right, make sure you are developing and testing against the same database platform you are going to use in production, there is a world of difference in how they operate. Sure, you should be able to abstract it away to not care about whether you are using SQL or Oracle, but that is almost never really the case.


No, you can't. Although LINQ to SQL was initialy designed with multi-database support in mind (you can see this when looking at the code using .NET Reflector) using a provider model, this model was never made public and Microsoft has no intensions in adding multi-database support to LINQ to SQL.

If you need multi-database support, please use Entity Framework.


No, LINQ-to-SQL doesn't support Oracle. Internally, the project had support for multiple back-ends, but this never made it into the final public release. I believe LINQ-to-Entities supports other databases.

0

精彩评论

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

关注公众号