none
L2S Entity Set Names RRS feed

  • Question

  • When designing and Entity Data Model I am able to specify the name of an Entity as well as the Entity Set Name (ie Entity: Order; Entity Set: Orders). I don't see coresponding functionality when designing a Linq to SQL model. Is there a similar concept in LINQ to SQL? 

     
    Wednesday, February 4, 2009 11:40 PM

All replies

  • It uses an automatic naming system that is exactly like that as long as the table is named Order or Orders.  You can change the name if you want in the dbml (in the Properties window) and it will auto-generate the classes using the same naming convention.
    Daniel - http://webs.neumont.edu/dstafford
    Thursday, February 5, 2009 1:04 AM
  • dantheriver said:

    When designing and Entity Data Model I am able to specify the name of an Entity as well as the Entity Set Name (ie Entity: Order; Entity Set: Orders). I don't see coresponding functionality when designing a Linq to SQL model. Is there a similar concept in LINQ to SQL? 

     


    Yes, the same concept exist in L2S but only the class name is exposed in the VS property window. The name of the entity set (datacontext member) is stored separately in the dbml file but for some reason not exposed by the designer.

    Example - Table/@Member in the following dbml snippet will be the entity set name and Table/Type/@Name will be the class name:

      <Table Name="dbo.Orders" Member="Orders">
        <Type Name="Order">

    Kristofer - Huagati Systems Co., Ltd. - web: www.huagati.com - blog: blog.huagati.com - twitter: twitter.com/KristoferA
    Thursday, February 5, 2009 3:38 AM
    Answerer