BuildOptions() public méthode

public BuildOptions ( Type type ) : Enumeration
type System.Type
Résultat Enumeration
        private List <UrlParameter> GetUrlParameters(BehaviorChain chain)
        {
            var action = chain.FirstCall();

            var properties = _typeCache.GetPropertiesFor(action.InputType());

            return(action.ParentChain().Route.Input.RouteParameters.Select(
                       x => {
                var property = properties[x.Name];
                var description = _memberConvention.GetDescription(property);
                return _configuration.UrlParameterOverrides.Apply(chain, property, new UrlParameter {
                    Name = description.WhenNotNull(y => y.Name).OtherwiseDefault(),
                    Comments = description.WhenNotNull(y => y.Comments).OtherwiseDefault(),
                    Type = property.PropertyType.GetXmlName(_configuration.EnumFormat == EnumFormat.AsString),
                    Options = _optionFactory.BuildOptions(property.PropertyType)
                });
            }).ToList());
        }
Exemple #2
0
 private void BuildSimpleType(DataType dataType, Type type)
 {
     dataType.IsSimple = true;
     dataType.LongNamespace.Clear();
     dataType.ShortNamespace.Clear();
     if (type.GetNullableUnderlyingType().IsEnum)
     {
         dataType.Options = _optionFactory.BuildOptions(type);
     }
 }