private void AttachAndSavePermission(Entities ctx, int employeeId, Common.Enums.PermissionType permissionType)
 {
     if (!ctx.EmployeePermissions.Any(ep => ep.EmployeeId == employeeId &&
         ep.PermissionId == (int)permissionType))
     {
         var permission = new EmployeePermission
         {
             EmployeeId = employeeId,
             PermissionId = (int)permissionType
         };
         ctx.EmployeePermissions.Add(permission);
         ctx.SaveChanges();
     }
 }
 private void AttachAndSavePermission(Entities ctx, int employeeId, Common.Enums.PermissionType permissionType)
 {
     if (!ctx.EmployeePermissions.Any(ep => ep.EmployeeId == employeeId &&
                                      ep.PermissionId == (int)permissionType))
     {
         var permission = new EmployeePermission
         {
             EmployeeId   = employeeId,
             PermissionId = (int)permissionType
         };
         ctx.EmployeePermissions.Add(permission);
         ctx.SaveChanges();
     }
 }