Skip to content

Commit

Permalink
moved sample data to separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
alimon808 committed Oct 23, 2017
1 parent f2b8166 commit 6aaf87b
Show file tree
Hide file tree
Showing 12 changed files with 610 additions and 883 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*.sql
*.sqlite
*.DS_Store
*/Data/*


#EntityFramework Migrations
*/Migrations/*
Expand Down
11 changes: 9 additions & 2 deletions ContosoUniversity.Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,15 @@ public Startup(IHostingEnvironment env)
var builder = new ConfigurationBuilder()
.SetBasePath(env.ContentRootPath)
.AddJsonFile("appsettings.json", optional: false, reloadOnChange: true)
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true)
.AddUserSecrets<Startup>()
.AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true);

if (env.IsDevelopment() || env.IsEnvironment("Testing"))
{
builder.AddJsonFile($"sampleData.json", optional: true, reloadOnChange: false);
builder.AddUserSecrets<Startup>();
}

builder.AddUserSecrets<Startup>()
.AddEnvironmentVariables();
Configuration = builder.Build();

Expand Down
284 changes: 0 additions & 284 deletions ContosoUniversity.Api/appsettings.Development.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,289 +17,5 @@
"ClientId": "DO-NOT-STORE-HERE",
"ClientSecret": "DO-NOT-STORE-HERE"
}
},
"SampleData": {
"saveToExternalFile": false,
"courses": [
{
"ID": 1,
"CourseNumber": 1050,
"Title": "Chemistry",
"Credits": 3,
"DepartmentID": 3
},
{
"ID": 2,
"CourseNumber": 4022,
"Title": "Microeconomics",
"Credits": 3,
"DepartmentID": 4
},
{
"ID": 3,
"CourseNumber": 4041,
"Title": "Macroeconomics",
"Credits": 3,
"DepartmentID": 4
},
{
"ID": 4,
"CourseNumber": 1045,
"Title": "Calculus",
"Credits": 4,
"DepartmentID": 2
},
{
"ID": 5,
"CourseNumber": 3141,
"Title": "Trigonometry",
"Credits": 4,
"DepartmentID": 2
},
{
"ID": 6,
"CourseNumber": 2021,
"Title": "Composition",
"Credits": 3,
"DepartmentID": 1
},
{
"ID": 7,
"CourseNumber": 2042,
"Title": "Literature",
"Credits": 4,
"DepartmentID": 1
}
],
"courseAssignments": [
{
"InstructorID": 4,
"CourseID": 1
},
{
"InstructorID": 3,
"CourseID": 1
},
{
"InstructorID": 5,
"CourseID": 2
},
{
"InstructorID": 5,
"CourseID": 3
},
{
"InstructorID": 2,
"CourseID": 4
},
{
"InstructorID": 3,
"CourseID": 5
},
{
"InstructorID": 1,
"CourseID": 6
},
{
"InstructorID": 1,
"CourseID": 7
}
],
"departments": [
{
"ID": 1,
"InstructorID": 1,
"Name": "English",
"Budget": 350000.0,
"StartDate": "2007-09-01T00:00:00"
},
{
"ID": 2,
"InstructorID": 2,
"Name": "Mathematics",
"Budget": 100000.0,
"StartDate": "2007-09-01T00:00:00"
},
{
"ID": 3,
"InstructorID": 3,
"Name": "Engineering",
"Budget": 350000.0,
"StartDate": "2007-09-01T00:00:00"
},
{
"ID": 4,
"InstructorID": 4,
"Name": "Economics",
"Budget": 100000.0,
"StartDate": "2007-09-01T00:00:00"
}
],
"students": [
{
"ID": 6,
"FirstMidName": "Carson",
"LastName": "Alexander",
"EnrollmentDate": "2005-09-01T00:00:00"
},
{
"ID": 7,
"FirstMidName": "Meredith",
"LastName": "Alonso",
"EnrollmentDate": "2002-09-01T00:00:00"
},
{
"ID": 8,
"FirstMidName": "Arturo",
"LastName": "Anand",
"EnrollmentDate": "2003-09-01T00:00:00"
},
{
"ID": 9,
"FirstMidName": "Gytis",
"LastName": "Barzdukas",
"EnrollmentDate": "2002-09-01T00:00:00"
},
{
"ID": 10,
"FirstMidName": "Yan",
"LastName": "Li",
"EnrollmentDate": "2002-09-01T00:00:00"
},
{
"ID": 11,
"FirstMidName": "Peggy",
"LastName": "Justice",
"EnrollmentDate": "2001-09-01T00:00:00"
},
{
"ID": 12,
"FirstMidName": "Laura",
"LastName": "Norman",
"EnrollmentDate": "2003-09-01T00:00:00"
},
{
"ID": 13,
"FirstMidName": "Nino",
"LastName": "Olivetto",
"EnrollmentDate": "2005-09-01T00:00:00"
}
],
"enrollments": [
{
"ID": 1,
"CourseID": 1,
"StudentID": 6,
"Grade": 0
},
{
"ID": 2,
"CourseID": 2,
"StudentID": 6,
"Grade": 2
},
{
"ID": 3,
"CourseID": 3,
"StudentID": 6,
"Grade": 1
},
{
"ID": 4,
"CourseID": 4,
"StudentID": 7,
"Grade": 1
},
{
"ID": 5,
"CourseID": 5,
"StudentID": 7,
"Grade": 1
},
{
"ID": 6,
"CourseID": 6,
"StudentID": 7,
"Grade": 1
},
{
"ID": 7,
"CourseID": 1,
"StudentID": 8
},
{
"ID": 8,
"CourseID": 2,
"StudentID": 8,
"Grade": 1
},
{
"ID": 9,
"CourseID": 1,
"StudentID": 9,
"Grade": 1
},
{
"ID": 10,
"CourseID": 6,
"StudentID": 10,
"Grade": 1
},
{
"ID": 11,
"CourseID": 7,
"StudentID": 11,
"Grade": 1
}
],
"officeAssignments": [
{
"ID": 1,
"InstructorID": 2,
"Location": "Smith 17"
},
{
"ID": 2,
"InstructorID": 3,
"Location": "Gowan 27"
},
{
"ID": 3,
"InstructorID": 4,
"Location": "Thompson 304"
}
],
"instructors": [
{
"ID": 1,
"FirstMidName": "Kim",
"LastName": "Abercrombie",
"HireDate": "1995-03-11T00:00:00"
},
{
"ID": 2,
"FirstMidName": "Fadi",
"LastName": "Fakhouri",
"HireDate": "2002-07-06T00:00:00"
},
{
"ID": 3,
"FirstMidName": "Roger",
"LastName": "Harui",
"HireDate": "1998-07-01T00:00:00"
},
{
"ID": 4,
"FirstMidName": "Candace",
"LastName": "Kapoor",
"HireDate": "2001-01-15T00:00:00"
},
{
"ID": 5,
"FirstMidName": "Roger",
"LastName": "Zheng",
"HireDate": "2004-02-12T00:00:00"
}
]
}
}
Loading

0 comments on commit 6aaf87b

Please sign in to comment.