public MicroOrmComparison.UI.Models.Employee Add(MicroOrmComparison.UI.Models.Employee employee)
 {
     var employeeToInsert = AutoMapper.Mapper.Map<MicroOrmComparison.UI.Models.Employee, Employee>(employee);
     using (var db = new EmployeeDb())
     {
         db.Employees.AddOrUpdate(employeeToInsert);
         if (employeeToInsert.Addresses != null)
         {
             foreach (var address in employeeToInsert.Addresses)
             {
                 db.Addresses.AddOrUpdate(address);
             }
         }
         if (employeeToInsert.AssignedRoles != null)
         {
             foreach (var roleId in employeeToInsert.AssignedRoles.Select(x => x.Id).Distinct())
             {
                 var roleToInsert = new AssignedRole
                 {
                     EmployeeId = employeeToInsert.Id,
                     RoleId = roleId
                 };
                 db.AssignedRoles.Add(roleToInsert);
             }
         }
         db.SaveChanges();
         employee.Id = employeeToInsert.Id;
     }
     return employee;
 }
 public MicroOrmComparison.UI.Models.Employee Update(MicroOrmComparison.UI.Models.Employee employee)
 {
     return Add(employee);
 }
 public void Save(MicroOrmComparison.UI.Models.Employee employee)
 {
     Add(employee);
 }