public Result <DataProcessingCountryOption, OperationError> RemoveInsecureCountrySubjectToDataTransfer(DataProcessingCountryOption country) { if (country == null) { throw new ArgumentNullException(nameof(country)); } if (!HasInsecureCountry(country)) { return(new OperationError("Country not assigned", OperationFailure.Conflict)); } InsecureCountriesSubjectToDataTransfer.Remove(country); return(country); }
private bool HasInsecureCountry(DataProcessingCountryOption country) { return(InsecureCountriesSubjectToDataTransfer.Any(c => c.Id == country.Id)); }
public Result <DataProcessingCountryOption, OperationError> AssignInsecureCountrySubjectToDataTransfer(DataProcessingCountryOption country) { if (country == null) { throw new ArgumentNullException(nameof(country)); } if (TransferToInsecureThirdCountries != YesNoUndecidedOption.Yes) { return(new OperationError("To Add new insecure data transfer country, but transfer to insecure countries is not enabled", OperationFailure.BadInput)); } if (HasInsecureCountry(country)) { return(new OperationError("Country already assigned", OperationFailure.Conflict)); } InsecureCountriesSubjectToDataTransfer.Add(country); return(country); }