protected override async Task CheckEntityReferences(Employee employee)
        {
            // No need to validate BranchOfficeId, 'cause we trust it, because we assign it ourselves
            await ReferenceValidatorForTenant.ValidateRequiredEntityReference(employee, _departmentRepository, employee.DepartmentId);

            await ReferenceValidatorForTenant.ValidateRequiredEntityReference(employee, _positionRepository, employee.PositionId);
        }
Beispiel #2
0
 protected override async Task CheckEntityReferences(Position value)
 {
     // it is not allowed to refer to a branch office
     // that does not belong to the same tenant
     if (value.BranchOfficeId.HasValue)
     {
         await ReferenceValidatorForTenant.ValidateOptionalEntityReference(value, _branchOfficeRepository, value.BranchOfficeId.Value);
     }
 }
 protected override async Task CheckEntityReferences(Department value)
 {
     // it is not allowed to refer to a branch office
     // that does not belong to the same tenant
     await ReferenceValidatorForTenant.ValidateRequiredEntityReference(value, _branchOfficeRepository, value.BranchOfficeId);
 }