Ejemplo n.º 1
0
 //TODO: Validation rules for this property
 public static PropertyApiDescriptionModel Create(PropertyInfo propertyInfo)
 {
     return(new PropertyApiDescriptionModel
     {
         Name = propertyInfo.Name,
         Type = ApiTypeNameHelper.GetTypeName(propertyInfo.PropertyType),
         TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(propertyInfo.PropertyType)
     });
 }
Ejemplo n.º 2
0
 //TODO: Validation rules for this property
 public static PropertyApiDescriptionModel Create(PropertyInfo propertyInfo)
 {
     return(new PropertyApiDescriptionModel
     {
         Name = propertyInfo.Name,
         Type = ApiTypeNameHelper.GetTypeName(propertyInfo.PropertyType),
         TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(propertyInfo.PropertyType),
         IsRequired = propertyInfo.IsDefined(typeof(RequiredAttribute), true)
     });
 }
        public static ReturnValueApiDescriptionModel Create(Type type)
        {
            var unwrappedType = AsyncHelper.UnwrapTask(type);

            return(new ReturnValueApiDescriptionModel
            {
                Type = TypeHelper.GetFullNameHandlingNullableAndGenerics(unwrappedType),
                TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(unwrappedType)
            });
        }
Ejemplo n.º 4
0
 //TODO: Validation rules for this property
 public static PropertyApiDescriptionModel Create(PropertyInfo propertyInfo)
 {
     return(new PropertyApiDescriptionModel
     {
         Name = propertyInfo.Name,
         JsonName = AbpApiProxyScriptingOptions.PropertyNameGenerator.Invoke(propertyInfo),
         Type = ApiTypeNameHelper.GetTypeName(propertyInfo.PropertyType),
         TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(propertyInfo.PropertyType),
         IsRequired = propertyInfo.IsDefined(typeof(RequiredAttribute), true)
     });
 }
 public static MethodParameterApiDescriptionModel Create(ParameterInfo parameterInfo)
 {
     return(new MethodParameterApiDescriptionModel
     {
         Name = parameterInfo.Name,
         TypeAsString = parameterInfo.ParameterType.GetFullNameWithAssemblyName(),
         Type = TypeHelper.GetFullNameHandlingNullableAndGenerics(parameterInfo.ParameterType),
         TypeSimple = ApiTypeNameHelper.GetSimpleTypeName(parameterInfo.ParameterType),
         IsOptional = parameterInfo.IsOptional,
         DefaultValue = parameterInfo.HasDefaultValue ? parameterInfo.DefaultValue : null
     });
 }
Ejemplo n.º 6
0
 public static ParameterApiDescriptionModel Create(string name, string nameOnMethod, Type type, bool isOptional = false, object defaultValue = null, string[] constraintTypes = null, string bindingSourceId = null, string descriptorName = null)
 {
     return(new ParameterApiDescriptionModel
     {
         Name = name,
         NameOnMethod = nameOnMethod,
         Type = type != null?TypeHelper.GetFullNameHandlingNullableAndGenerics(type) : null,
                    TypeSimple = type != null?ApiTypeNameHelper.GetSimpleTypeName(type) : null,
                                     IsOptional = isOptional,
                                     DefaultValue = defaultValue,
                                     ConstraintTypes = constraintTypes,
                                     BindingSourceId = bindingSourceId,
                                     DescriptorName = descriptorName
     });
 }