Beispiel #1
0
 private static void RemovePreviousData(EmployeeBookEntities context)
 {
     context.EmployeePositionSkills.ToList().ForEach(x => context.EmployeePositionSkills.Remove(x));
     context.EmployeePositions.ToList().ForEach(x => context.EmployeePositions.Remove(x));
     context.PositionSkills.ToList().ForEach(x => context.PositionSkills.Remove(x));
     context.Employees.ToList().ForEach(x => context.Employees.Remove(x));
     context.Positions.ToList().ForEach(x => context.Positions.Remove(x));
     context.Skills.ToList().ForEach(x => context.Skills.Remove(x));
 }
Beispiel #2
0
 public static void InsertExampleData(EmployeeBookEntities context)
 {
     RemovePreviousData(context);
     InsertEmployees(context);
     InsertPositions(context);
     InsertSkills(context);
     AddSkillsToPositions();
     AddPositionsToEmployees();
     AddSkillsToEmployees();
 }
Beispiel #3
0
 private static void InsertSkills(EmployeeBookEntities context)
 {
     context.Skills.Add(Cpp);
     context.Skills.Add(CSharp);
     context.Skills.Add(CSharpBase);
     context.Skills.Add(JavaBase);
     context.Skills.Add(Xaml);
     context.Skills.Add(Css);
     context.Skills.Add(Javadoc);
 }
Beispiel #4
0
 private static void InsertPositions(EmployeeBookEntities context)
 {
     context.Positions.Add(Junior);
     context.Positions.Add(TechnicalWriter);
     context.Positions.Add(Designer);
 }
Beispiel #5
0
 private static void InsertEmployees(EmployeeBookEntities context)
 {
     context.Employees.Add(Ivan);
     context.Employees.Add(Grigory);
 }