none
EDMX issue adding same table name multiple time RRS feed

  • Question

  • I'm getting same table multiple time when i want to adding EDMX file.

    for example TEST table is a main this table linked with 50 table by FKeys 

    so when i'm adding EDMX then adding same table name multiple time in TEST main table,(child reference)

     like TEST_EMP,

    TEST_EMP_1,TEST_EMP_2,

    TEST_EMPTB,TEST_EMPTB_1,TEST_EMPTB,TEST_EMPTB_2.

    Entity framework automatically added at the end of TEST_EMP (_1,_2)

    i'm facing this problem.

    please help me how can i resolve this issue,

    Thanks in advance.

    Monday, May 14, 2018 4:24 AM

All replies

  • Hi Balwindersingh840,

    >>so when i'm adding EDMX then adding same table name multiple time in TEST main table,(child reference)

    According to your description, you add the same table name multiple time in TEST main table, could you please show the steps and related screenshot to reproduce the issue.

    In addition, can you modify the table name As your requirement? if the operation generate file, class, etc, it can't have the duplicate name.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, May 15, 2018 1:53 AM
    Moderator
  • Hi Zhanglong,

    I'm facing this issue in .tt file when constructor of invoke,

    in constructor Employee Employee_DBS added two time automatically,

    and also public virtual ICollection<Employee_DBS> reference added two time 

    public partial class Employee

    [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2214:DoNotCallOverridableMethodsInConstructors")]
            public Employee()
            {

                this.Employee_DBS = new HashSet<Employee_DBS>();
                this.Employee_DBS1 = new HashSet<Employee_DBS>();

             }

            

            public System.Guid EmployeePersonId { get; set; }
            public System.Guid CustomerId { get; set; }

          [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage",                 "CA2227:CollectionPropertiesShouldBeReadOnly")]
            public virtual ICollection<Employee_DBS> Employee_DBS { get; set; }
            [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Usage", "CA2227:CollectionPropertiesShouldBeReadOnly")]
            public virtual ICollection<Employee_DBS> Employee_DBS1 { get; set; }

    }}

    Tuesday, May 15, 2018 7:37 AM
  • Hi Balwindersingh840,

    >>in constructor Employee Employee_DBS added two time automatically,

    What operation cause Employee Employee_DBS added two time automatically? if possible, please share related screenshot.

    Best regards,

    Zhanglong


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, May 17, 2018 9:00 AM
    Moderator