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); }
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); }