Articles → Light Switch 2011 → Creation Of Data Entity In Light Switch 2011

Creation Of Data Entity In Light Switch 2011






Software Requirements


  1. Visual studio 2010 ultimate(or premium)
  2. Visual studio 2010 service pack 1
  3. Silverlight 5 exe which you will get from http://go.microsoft.com/fwlink/?LinkID=198365
  4. Light switch 2011 which you can download from http://www.microsoft.com/visualstudio/en-us/lightswitch

Implementation




Picture showing the lightswitch application from the visual studio installed project templates
Click to Enlarge





Picture showing create new table link to create a table in the lightswitch application
Click to Enlarge





Picture showing renaming the table name from the Table1Item to Employee
Click to Enlarge





Picture showing the fields added in the lightswitch tables
Click to Enlarge





Picture showing Relationship button for adding the relationship between the tables
Click to Enlarge





Picture showing the popup window for adding relationship between the entites
Click to Enlarge





SectionNameMultiplicity
FromDepartmentOne
ToEmployeeMany




SectionNameMultiplicity
FromDepartmentZero or one
ToEmployeeMany








DepartmentOn Delete BehaviorDescription
DepartmentRestrictedRecords in Department cannot be deleted if there is any associated record present in Employee table
EmployeeNA 


DepartmentOn Delete BehaviorDescription
DepartmentCascade DeleteIf any record in Department is deleted then delete all the associated records from the Employee table also.
EmployeeNA 


DepartmentOn Delete BehaviorDescription
DepartmentDisassociateIf the records in Department table deleted then the records in Employee table will remain intact.
EmployeeNA 




Picture showing the relationship established between the tables in lightswitch
Click to Enlarge


Error

















Posted By  -  Karan Gupta
 
Posted On  -  Monday, December 19, 2011

Query/Feedback


Your Email Id
 
Subject
 
Query/FeedbackCharacters remaining 250