AppMetadataUtils
Assembly: ServiceStack.Client.dll
Declaration
public static class AppMetadataUtils
Methods
Declaration
public static AppMetadataCache GetCache(this AppMetadata app)
Returns
ServiceStack.AppMetadataCache
Parameters
Declaration
public static MetadataOperationType GetOperation(this AppMetadata app, string name)
Returns
ServiceStack.MetadataOperationType
Parameters
Declaration
public static MetadataType GetType(this AppMetadata app, Type type)
Returns
ServiceStack.MetadataType
Parameters
Declaration
public static MetadataType GetType(this AppMetadata app, string name)
Returns
ServiceStack.MetadataType
Parameters
Declaration
public static MetadataType GetType(this AppMetadata app, MetadataTypeName typeRef)
Returns
ServiceStack.MetadataType
Parameters
Declaration
public static MetadataType GetType(this AppMetadata app, string namespace, string name)
Returns
ServiceStack.MetadataType
Parameters
Declaration
public static void EachOperation(this AppMetadata app, Action<MetadataOperationType> configure)
Parameters
Declaration
public static void EachOperation(this AppMetadata app, Action<MetadataOperationType> configure, Predicate<MetadataOperationType> where)
Parameters
Type | Name |
---|
ServiceStack.AppMetadata | app |
System.Action<ServiceStack.MetadataOperationType> | configure |
System.Predicate<ServiceStack.MetadataOperationType> | where |
Declaration
public static void EachType(this AppMetadata app, Action<MetadataType> configure)
Parameters
Declaration
public static void EachType(this AppMetadata app, Action<MetadataType> configure, Predicate<MetadataType> where)
Parameters
Type | Name |
---|
ServiceStack.AppMetadata | app |
System.Action<ServiceStack.MetadataType> | configure |
System.Predicate<ServiceStack.MetadataType> | where |
Declaration
public static async Task<AppMetadata> GetAppMetadataAsync(this string baseUrl)
Returns
System.Threading.Tasks.Task<ServiceStack.AppMetadata>
Parameters
Type | Name |
---|
System.String | baseUrl |
ToCss(FieldCssAttribute)
Declaration
public static FieldCss ToCss(this FieldCssAttribute attr)
Returns
ServiceStack.FieldCss
Parameters
Declaration
public static InputInfo ToInput(this InputAttributeBase input, Action<InputInfo> configure = null)
Returns
ServiceStack.InputInfo
Parameters
Declaration
public static FormatInfo ToFormat(this FormatAttribute attr)
Returns
ServiceStack.FormatInfo
Parameters
Declaration
public static FormatInfo ToFormat(this Intl attr)
Returns
ServiceStack.FormatInfo
Parameters
Declaration
public static MetadataPropertyType Property(this MetadataType type, string name)
Returns
ServiceStack.MetadataPropertyType
Parameters
Declaration
public static MetadataPropertyType RequiredProperty(this MetadataType type, string name)
Returns
ServiceStack.MetadataPropertyType
Parameters
Declaration
public static void Property(this MetadataType type, string name, Action<MetadataPropertyType> configure)
Parameters
Reorder where the DB Column appears in Type (changes API & UI ordering)
Declaration
public static MetadataPropertyType ReorderProperty(this MetadataType type, string name, string before = null, string after = null)
Returns
ServiceStack.MetadataPropertyType
Parameters
Reorder where the DB Column appears in Type (changes API & UI ordering)
Declaration
public static MetadataPropertyType ReorderProperty(this MetadataType type, string name, int index)
Returns
ServiceStack.MetadataPropertyType
Parameters
Apply custom lambda to each matching property
Declaration
public static void EachProperty(this MetadataType type, Func<MetadataPropertyType, bool> where, Action<MetadataPropertyType> configure)
Parameters
Type | Name |
---|
ServiceStack.MetadataType | type |
System.Func<ServiceStack.MetadataPropertyType,System.Boolean> | where |
System.Action<ServiceStack.MetadataPropertyType> | configure |
Omit properties that match filter from inclusion in code-gen type
Declaration
public static void RemoveProperty(this MetadataType type, Predicate<MetadataPropertyType> where)
Parameters
Omit property from inclusion in code-gen type
Declaration
public static void RemoveProperty(this MetadataType type, string name)
Parameters
Declaration
public static bool IsSystemType(this MetadataPropertyType prop)
Returns
System.Boolean
Parameters
Declaration
public static string GetSerializedAlias(this MetadataPropertyType prop)
Returns
System.String
Parameters
Declaration
public static MetadataPropertyType GetPrimaryKey(this List<MetadataPropertyType> props)
Returns
ServiceStack.MetadataPropertyType
Parameters
Type | Name |
---|
System.Collections.Generic.List<ServiceStack.MetadataPropertyType> | props |
Declaration
public static object GetId<T>(this MetadataType type, T model)
Returns
System.Object
Parameters
Type Parameters
Declaration
public static object GetId<T>(this List<MetadataPropertyType> props, T model)
Returns
System.Object
Parameters
Type | Name |
---|
System.Collections.Generic.List<ServiceStack.MetadataPropertyType> | props |
<T> | model |
Type Parameters
Declaration
public static object GetValue<T>(this MetadataPropertyType prop, T model)
Returns
System.Object
Parameters
Type Parameters
GetResponseType(Type)
Declaration
public static Type GetResponseType(this Type requestType)
Returns
System.Type
Parameters
Type | Name |
---|
System.Type | requestType |
Declaration
public static MetadataType ToMetadataType(this Type type)
Returns
ServiceStack.MetadataType
Parameters
Declaration
public static List<MetadataPropertyType> ToProperties(Type type, Func<PropertyInfo, MetadataPropertyType> toProperty, HashSet<Type> exportTypes = null)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
Type | Name |
---|
System.Type | type |
System.Func<System.Reflection.PropertyInfo,ServiceStack.MetadataPropertyType> | toProperty |
System.Collections.Generic.HashSet<System.Type> | exportTypes |
Declaration
public static List<MetadataPropertyType> PopulatePrimaryKey(this List<MetadataPropertyType> props)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
Type | Name |
---|
System.Collections.Generic.List<ServiceStack.MetadataPropertyType> | props |
Declaration
public static List<MetadataPropertyType> GetAllMetadataProperties(this Type type)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, string typeName)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, string namespace, string typeName)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, MetadataType metaType)
Returns
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>
Parameters
GetInstancePublicProperties(Type)
Declaration
public static PropertyInfo[] GetInstancePublicProperties(this Type type)
Returns
System.Reflection.PropertyInfo[]
Parameters
Declaration
public static MetadataPropertyType ToMetadataPropertyType(this PropertyInfo pi, object instance = null, Dictionary<string, object> ignoreValues = null, bool treatNonNullableRefTypesAsRequired = true)
Returns
ServiceStack.MetadataPropertyType
Parameters
Type | Name |
---|
System.Reflection.PropertyInfo | pi |
System.Object | instance |
System.Collections.Generic.Dictionary<System.String,System.Object> | ignoreValues |
System.Boolean | treatNonNullableRefTypesAsRequired |
Declaration
public static void PopulateInput(this MetadataPropertyType property, InputInfo input)
Parameters
PropertyStringValue(PropertyInfo, Object, Object)
Declaration
public static string PropertyStringValue(this PropertyInfo pi, object instance, object ignoreIfValue = null)
Returns
System.String
Parameters
Type | Name |
---|
System.Reflection.PropertyInfo | pi |
System.Object | instance |
System.Object | ignoreIfValue |
PropertyValueAsString(PropertyInfo, Object)
Declaration
public static string PropertyValueAsString(this PropertyInfo pi, object value)
Returns
System.String
Parameters
Type | Name |
---|
System.Reflection.PropertyInfo | pi |
System.Object | value |
ToDataMember(DataMemberAttribute)
Declaration
public static MetadataDataMember ToDataMember(this DataMemberAttribute attr)
Returns
ServiceStack.MetadataDataMember
Parameters
Type | Name |
---|
System.Runtime.Serialization.DataMemberAttribute | attr |
ToGenericArgs(Type)
Declaration
public static string[] ToGenericArgs(this Type propType)
Returns
System.String[]
Parameters
Type | Name |
---|
System.Type | propType |
GetIcon(Type)
Declaration
public static ImageInfo GetIcon(this Type type)
Returns
ServiceStack.ImageInfo
Parameters
Declaration
public static ImageInfo GetIcon(this MetadataType type)
Returns
ServiceStack.ImageInfo
Parameters