예제 #1
0
        public RemoveValueResponse RemoveValue(RemoveValueRequest request)
        {
            Type enumClass = null;

            try
            {
                enumClass = GetEnumClass(request.AssemblyQualifiedClassName);

                // Client side should enforce this.  But just in case it does not.
                if (IsSoftEnum(enumClass) == false)
                {
                    throw new RequestValidationException(SR.ExceptionUnableToDeleteHardEnumeration);
                }

                var broker = PersistenceContext.GetBroker <IEnumBroker>();
                broker.RemoveValue(enumClass, request.Value.Code);
                PersistenceContext.SynchState();
                return(new RemoveValueResponse());
            }
            catch (PersistenceException)
            {
                throw new RequestValidationException(string.Format(SR.ExceptionFailedToDelete, TerminologyTranslator.Translate(enumClass)));
            }
        }
예제 #2
0
 private void RemoveValue(RemoveValueRequest removeValueRequest)
 {
     _rest.Resolve("remove").Post(removeValueRequest);
 }