-
Notifications
You must be signed in to change notification settings - Fork 0
/
MasterRecord.js
49 lines (35 loc) · 1.01 KB
/
MasterRecord.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// https://github.com/kriasoft/node-sqlite
// https://www.learnentityframeworkcore.com/dbset/deleting-data
// version 1.0.20
var context = require("./context");
var schema = require("./Migrations/schema");
class masterrecord{
constructor(){
this.context = context;
this.schema = schema;
}
}
module.exports = new masterrecord();
/*
//Create new standard
var standard = new Standard();
standard.StandardName = "Standard1";
//create three new teachers
var teacher1 = new Teacher();
teacher1.TeacherName = "New Teacher1";
var teacher2 = new Teacher();
teacher2.TeacherName = "New Teacher2";
var teacher3 = new Teacher();
teacher3.TeacherName = "New Teacher3";
//add teachers for new standard
standard.Teachers.Add(teacher1);
standard.Teachers.Add(teacher2);
standard.Teachers.Add(teacher3);
using (var dbCtx = new SchoolDBEntities())
{
//add standard entity into standards entitySet
dbCtx.Standards.Add(standard);
//Save whole entity graph to the database
dbCtx.SaveChanges();
}
*/