Extensibility Methods Not Being Created (Partial Methods)
The Extensibility Methods of my Linq-to-Sql DataContext are not being created for some classes when I save the .dbml file in the designer.
It appears this happens when a Database Table has the same name as the .dbml file. Example:
The Northwind.dbml file is associated with a database (name of the database does not appear to affect the outcome)
That database has a table called “Northwind” (the same name as the .dbml file itself - The Table and Database do not necessarily share a name however)
The “Northwind” table is dragged into the .dbml design surface and creates a “Northwind” Data Class.
When the Northwind.dbml file is saved, a “public partial class Northwind” class is created in the “Northwind.designer.cs” file (along with the NorthwindDataContext class) and the correct Properties are added to it, but the “Extensibility Method Definitions” region is not. (if other Data Classes exist, Extensibility Method regions are correctly added to those classes)
The name of the Data Class itself does not seem to be the problem, if the class is renamed to “NorthwindEntity” in the designer, but the Table in the database is “Northwind” the problem still exists.
Answers
Hi Aaron,
Welcome to LINQ to SQL forum!
I tried to repro this issue at my lab, but with no avail. My dbml file has the same name as one data table name, but the extension methods in the DataContext and the table are all auto-generated correctly.
Aaron, please make sure your have installed the Visual Studio 2008 SP1 to avoid some unexpected issues in former VS versions. You can find the update package here, http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en.
If the problem still exists, could you please provide us with more detailed information about how to repro this issue? If it is convenient, would you mind sending me a repro project and database file for further investigation?
Have a nice day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byAaronHoffman Thursday, November 05, 2009 6:42 PM
All Replies
- Passibly "Northwind" table does not have private key. Linq To Sql does not treat this class as entity.
Pavel Kolesnikov, Devart Team
http://www.devart.com/dotconnect
ADO.NET data providers for Oracle, MySQL, PostgreSQL, SQLite with Entity Framework and LINQ to SQL support The "Northwind" Table does have a primary key, and is also an "Identity"
Hi Aaron,
Welcome to LINQ to SQL forum!
I tried to repro this issue at my lab, but with no avail. My dbml file has the same name as one data table name, but the extension methods in the DataContext and the table are all auto-generated correctly.
Aaron, please make sure your have installed the Visual Studio 2008 SP1 to avoid some unexpected issues in former VS versions. You can find the update package here, http://www.microsoft.com/downloads/details.aspx?FamilyId=FBEE1648-7106-44A7-9649-6D9F6D58056E&displaylang=en.
If the problem still exists, could you please provide us with more detailed information about how to repro this issue? If it is convenient, would you mind sending me a repro project and database file for further investigation?
Have a nice day!
Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byAaronHoffman Thursday, November 05, 2009 6:42 PM
I did have VS2008SP1 installed yesterday when this issue was occurring, however I have tried to reproduce this issue again today while recording my screen, and I can not.
I should have just tried recording my screen yesterday :-)
I’ll post here again if I can figure it out. Thanks.Hi Aaron,
If you need any further assistance, please feel free to tell me.
Have a nice weekend!Best Regards,
Lingzhi SunMSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg@microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.


