ASP.net MVC - OneToOne relationship with pluralized nomenclature
- by ludicco
Hi,
I have an OneToOne relationship between my models Account and Company
the table names are Accounts and Companies respectively.
Here is a brief screenshot of the structure: http://cl.ly/1AEU
Everything works well, but mysteriously when I use the OneToOne associations I have accessors like:
var db = new DB();
var account = db.Accounts.First();
var company = account.Companies; // note the plural not the singular accessor
So, what's happing is that even if using OneToOne association, I still get the plural accessor with "companies" and not "company", if it this is a pure object representation and not an EntitySet generated in case when it s an oneToMany relationship.
Is there a way to get this nomenclature to be applied properly?
Thanks a lot