コード例 #1
0
        public Result <DataProcessingOversightOption, OperationError> RemoveOversightOption(DataProcessingOversightOption oversightOption)
        {
            if (oversightOption == null)
            {
                throw new ArgumentNullException(nameof(oversightOption));
            }
            if (!HasOversightOption(oversightOption))
            {
                return(new OperationError("Oversight option not assigned", OperationFailure.BadInput));
            }

            OversightOptions.Remove(oversightOption);

            return(oversightOption);
        }
コード例 #2
0
 private bool HasOversightOption(DataProcessingOversightOption oversightOption)
 {
     return(OversightOptions.Any(x => x.Id == oversightOption.Id));
 }
コード例 #3
0
        public Result <DataProcessingOversightOption, OperationError> AssignOversightOption(DataProcessingOversightOption oversightOption)
        {
            if (oversightOption == null)
            {
                throw new ArgumentNullException(nameof(oversightOption));
            }
            if (HasOversightOption(oversightOption))
            {
                return(new OperationError("Oversight option already assigned", OperationFailure.Conflict));
            }

            OversightOptions.Add(oversightOption);

            return(oversightOption);
        }