hostaddonltd
New Member
I'm using asp.net and mvc 3 to create my application. Here is a simplified version of my tables.My tables are as follows[STUDENT] (ID, NAME)[CLASS] (ID, SUBJECT)[CLASSINSTANCE] (ID, SUBJECT, CLASSID)[CLASSINSTANCEDETAIL] (STUDENTID, CLASSINSTANCEID, ATTENDANCE)[ENROLLEDIN] (STUDENTID, CLASSID)I have relationships between student and classCLASS <- 1 to MANY -> CLASSINSTANCE <- 1 TO MANY -> CLASSINSTANCEDETAIL <- MANY to 1 -> STUDENT STUDENT <- 1 to MANY -> ENROLLEDIN <- MANY to 1 -> ClassEssentially what I need to do, is evertime I create a new Class, I also need to add a new record in the ClassDetail table with the class id of the class and a matching student id in the enrolledin table for each student. eg. If I created a new classinstance, then I would need to find the classID in that table, and add a new row of data for every student in the ENROLLEDIN table that has a matching classID.If anyone has any idea how to do this in c# using mvc3 and asp.net, I would be extremely grateful!PS. I imported my database using the entity framework with my model in a data access layer folder if that makes any difference.