Software-Entwicklung, Projektleitung, Web-Design
Kontakt:   +41 61 927 18 30
You are here:

Blog

Missing relationships in Lightswitch and/or Entity Framework

by Joerg Lang | Nov 06, 2012

Recently I was struggling with a problem that was a real tough cookie.

I was using Lightswitch to create a few simple data entry screens, but when picking the tables from the SQL Server database, no relations were imported. I double checked that the relations do exist in SQL Server and they did. Then I tried to add the same tables to an Entity Framework data context with the same result. Tables got imported, but relations were missing.

After a lot of try and error I finally found the reason for this behaviour. I had (or better the tool I use for data modeling) has created an additional index on the primary key column. After removing that second (not required) index from the primary key column, Entity Framework and Lightswitch picked up the relations. Hooray...

 

 

Comment

  1. RadEditor - HTML WYSIWYG Editor. MS Word-like content editing experience thanks to a rich set of formatting tools, dropdowns, dialogs, system modules and built-in spell-check.
    RadEditor's components - toolbar, content area, modes and modules
       
    Toolbar's wrapper 
     
    Content area wrapper
    RadEditor's bottom area: Design, Html and Preview modes, Statistics module and resize handle.
    It contains RadEditor's Modes/views (HTML, Design and Preview), Statistics and Resizer
    Editor Mode buttonsStatistics moduleEditor resizer
      
    RadEditor's Modules - special tools used to provide extra information such as Tag Inspector, Real Time HTML Viewer, Tag Properties and other.