本文介绍了在对象关系设计器中使用LINQ到SQl时,打开Pluralization ON / OF有什么影响?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,



我有2个场景,



场景1:

好​​的,我正在使用对象关系设计器,我将我的数据库表拖到ORD(对象关系设计器)



我转到工具选项,然后进入O / R设计器,然后当我看到启用多重化选项时,它默认设置为true。





现在,我实例化了DataContext类,如下所示(我给DataContext类提供了一些随机名称):



Hello Friends,

I have 2 scenarios,

Scenario 1:
Ok, i was using the Object Relational Designer, i dragged my database table into the ORD(Object Relational Designer)

I went to the tools option, then into the O/R designer and then when i saw the Enable Pluralization option, it was by default set to true.


Now, i instantiated the DataContext class like below(I gave some random name to the DataContext class):

MyDataBaseDataContext db = new MyDataBaseDataContext(connectionString);







因此,我很难直接访问实际的表格数据库。





情景2:



现在,我再次去了回到启用多重化的选项,我将其关闭。这一次,每件事都不同。添加了DataContext类中的另一个重载,它是一个空构造函数(它不要求任何连接字符串)。





然后我直接实例化了datacontext类并使用它的对象来查询我的表。







为什么这发生了吗?什么是启用和禁用多元化的差异?



非常感谢,

Rahul




So, it became difficult for me to directly access the actual table from the database.


Scenario 2:

Now, i again went back to the option of Enable Pluralization, i turned it off. This time, every thing was different. Another overload in the DataContext class was added, it was an empty constructor(it din't ask for any connection string).


I then directly instantiated the datacontext class and used its object to querry my table.



Why does this happen? whats the difference in enabling and disabling the pluralization?

Thanks a ton,
Rahul

推荐答案


这篇关于在对象关系设计器中使用LINQ到SQl时,打开Pluralization ON / OF有什么影响?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 21:22