private void SetLinks(HttpRequestMessage req, IObjectFacade objectFacade, FieldFacadeAdapter parameter) {
            var tempLinks = new List<LinkRepresentation>();

            if (parameter.IsAutoCompleteEnabled || parameter.GetChoicesParameters().Any()) {
                tempLinks.Add(CreatePromptLink(req, objectFacade, parameter));
            }

            Links = tempLinks.ToArray();
        }
        private LinkRepresentation CreatePromptLink(HttpRequestMessage req, IObjectFacade objectFacade, FieldFacadeAdapter parameter) {
            var opts = new List<OptionalProperty>();

         
            if (parameter.IsAutoCompleteEnabled) {
                var arguments = new OptionalProperty(JsonPropertyNames.Arguments, MapRepresentation.Create(new OptionalProperty(JsonPropertyNames.XRoSearchTerm, MapRepresentation.Create(new OptionalProperty(JsonPropertyNames.Value, null, typeof (object))))));
                var extensions = new OptionalProperty(JsonPropertyNames.Extensions, MapRepresentation.Create(new OptionalProperty(JsonPropertyNames.MinLength, parameter.AutoCompleteMinLength)));

                opts.Add(arguments);
                opts.Add(extensions);
            }
            else {
                Tuple<string, ITypeFacade>[] parms = parameter.GetChoicesParameters();
                OptionalProperty[] args = parms.Select(tuple => RestUtils.CreateArgumentProperty(OidStrategy, req, tuple, Flags)).ToArray();
                var arguments = new OptionalProperty(JsonPropertyNames.Arguments, MapRepresentation.Create(args));
                opts.Add(arguments);
            }

            return LinkRepresentation.Create(OidStrategy, new PromptRelType(parameter.GetHelper(OidStrategy, req, objectFacade)), Flags, opts.ToArray());
        }
 private static bool IsUnconditionalChoices(FieldFacadeAdapter parameter) {
     return parameter.IsChoicesEnabled != Choices.NotEnabled &&
            (parameter.Specification.IsParseable || (parameter.Specification.IsCollection && parameter.ElementType.IsParseable)) &&
            !parameter.GetChoicesParameters().Any();
 }