C# – Why is dbml generating extra classes

clinqlinq-to-sql

i am having a small problem here.

The table which dbml (LinqToSql designer) is using has columns (Foreign keys), for which it generates two objectsfor the coressponding Blogs table (1:1 association) in DB lmost same,

like

Table Authors: AuthorID INT, Name varchar(20), BlogID INT

And

TABLE BLOG: BlogID INT, Name varchar(MAX)

  • Blog { string name; int ID}
  • Blog1 { string name; int ID}

It appears in intellisense as well. I have even deleted and Added a new dbml, but still same results. What is going on ?

Best Answer

The only time I've had that happen is when I have two FK references in the database (I have multiple columns pointing to the same table via an FK), either I did this intentionally or I had two references by accident.

HTH.