Skip to main content

AppMetadataUtils

Assembly: ServiceStack.Client.dll​
View Source​
Declaration
public static class AppMetadataUtils

Methods​

GetCache(AppMetadata)​

View Source​
Declaration
public static AppMetadataCache GetCache(this AppMetadata app)
Returns​

ServiceStack.AppMetadataCache

Parameters​
TypeName
ServiceStack.AppMetadataapp

GetOperation(AppMetadata, String)​

View Source​
Declaration
public static MetadataOperationType GetOperation(this AppMetadata app, string name)
Returns​

ServiceStack.MetadataOperationType

Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Stringname

GetType(AppMetadata, Type)​

View Source​
Declaration
public static MetadataType GetType(this AppMetadata app, Type type)
Returns​

ServiceStack.MetadataType

Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Typetype

GetType(AppMetadata, String)​

View Source​
Declaration
public static MetadataType GetType(this AppMetadata app, string name)
Returns​

ServiceStack.MetadataType

Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Stringname

GetType(AppMetadata, MetadataTypeName)​

View Source​
Declaration
public static MetadataType GetType(this AppMetadata app, MetadataTypeName typeRef)
Returns​

ServiceStack.MetadataType

Parameters​
TypeName
ServiceStack.AppMetadataapp
ServiceStack.MetadataTypeNametypeRef

GetType(AppMetadata, String, String)​

View Source​
Declaration
public static MetadataType GetType(this AppMetadata app, string namespace, string name)
Returns​

ServiceStack.MetadataType

Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Stringnamespace
System.Stringname

EachOperation(AppMetadata, Action<MetadataOperationType>)​

View Source​
Declaration
public static void EachOperation(this AppMetadata app, Action<MetadataOperationType> configure)
Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Action<ServiceStack.MetadataOperationType>configure

EachOperation(AppMetadata, Action<MetadataOperationType>, Predicate<MetadataOperationType>)​

View Source​
Declaration
public static void EachOperation(this AppMetadata app, Action<MetadataOperationType> configure, Predicate<MetadataOperationType> where)
Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Action<ServiceStack.MetadataOperationType>configure
System.Predicate<ServiceStack.MetadataOperationType>where

EachType(AppMetadata, Action<MetadataType>)​

View Source​
Declaration
public static void EachType(this AppMetadata app, Action<MetadataType> configure)
Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Action<ServiceStack.MetadataType>configure

EachType(AppMetadata, Action<MetadataType>, Predicate<MetadataType>)​

View Source​
Declaration
public static void EachType(this AppMetadata app, Action<MetadataType> configure, Predicate<MetadataType> where)
Parameters​
TypeName
ServiceStack.AppMetadataapp
System.Action<ServiceStack.MetadataType>configure
System.Predicate<ServiceStack.MetadataType>where

GetAppMetadataAsync(String)​

View Source​
Declaration
public static async Task<AppMetadata> GetAppMetadataAsync(this string baseUrl)
Returns​

System.Threading.Tasks.Task<ServiceStack.AppMetadata>

Parameters​
TypeName
System.StringbaseUrl

ToCss(FieldCssAttribute)​

View Source​
Declaration
public static FieldCss ToCss(this FieldCssAttribute attr)
Returns​

ServiceStack.FieldCss

Parameters​
TypeName
ServiceStack.FieldCssAttributeattr

ToInput(InputAttributeBase, Action<InputInfo>)​

View Source​
Declaration
public static InputInfo ToInput(this InputAttributeBase input, Action<InputInfo> configure = null)
Returns​

ServiceStack.InputInfo

Parameters​
TypeName
ServiceStack.InputAttributeBaseinput
System.Action<ServiceStack.InputInfo>configure

ToFormat(FormatAttribute)​

View Source​
Declaration
public static FormatInfo ToFormat(this FormatAttribute attr)
Returns​

ServiceStack.FormatInfo

Parameters​
TypeName
ServiceStack.FormatAttributeattr

ToFormat(Intl)​

View Source​
Declaration
public static FormatInfo ToFormat(this Intl attr)
Returns​

ServiceStack.FormatInfo

Parameters​
TypeName
ServiceStack.Intlattr

Property(MetadataType, String)​

View Source​
Declaration
public static MetadataPropertyType Property(this MetadataType type, string name)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname

RequiredProperty(MetadataType, String)​

View Source​
Declaration
public static MetadataPropertyType RequiredProperty(this MetadataType type, string name)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname

Property(MetadataType, String, Action<MetadataPropertyType>)​

View Source​
Declaration
public static void Property(this MetadataType type, string name, Action<MetadataPropertyType> configure)
Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname
System.Action<ServiceStack.MetadataPropertyType>configure

ReorderProperty(MetadataType, String, String, String)​

Reorder where the DB Column appears in Type (changes API & UI ordering)

View Source​
Declaration
public static MetadataPropertyType ReorderProperty(this MetadataType type, string name, string before = null, string after = null)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname
System.Stringbefore
System.Stringafter

ReorderProperty(MetadataType, String, Int32)​

Reorder where the DB Column appears in Type (changes API & UI ordering)

View Source​
Declaration
public static MetadataPropertyType ReorderProperty(this MetadataType type, string name, int index)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname
System.Int32index

EachProperty(MetadataType, Func<MetadataPropertyType, Boolean>, Action<MetadataPropertyType>)​

Apply custom lambda to each matching property

View Source​
Declaration
public static void EachProperty(this MetadataType type, Func<MetadataPropertyType, bool> where, Action<MetadataPropertyType> configure)
Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Func<ServiceStack.MetadataPropertyType,System.Boolean>where
System.Action<ServiceStack.MetadataPropertyType>configure

RemoveProperty(MetadataType, Predicate<MetadataPropertyType>)​

Omit properties that match filter from inclusion in code-gen type

View Source​
Declaration
public static void RemoveProperty(this MetadataType type, Predicate<MetadataPropertyType> where)
Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Predicate<ServiceStack.MetadataPropertyType>where

RemoveProperty(MetadataType, String)​

Omit property from inclusion in code-gen type

View Source​
Declaration
public static void RemoveProperty(this MetadataType type, string name)
Parameters​
TypeName
ServiceStack.MetadataTypetype
System.Stringname

IsSystemType(MetadataPropertyType)​

View Source​
Declaration
public static bool IsSystemType(this MetadataPropertyType prop)
Returns​

System.Boolean

Parameters​
TypeName
ServiceStack.MetadataPropertyTypeprop

GetSerializedAlias(MetadataPropertyType)​

View Source​
Declaration
public static string GetSerializedAlias(this MetadataPropertyType prop)
Returns​

System.String

Parameters​
TypeName
ServiceStack.MetadataPropertyTypeprop

GetPrimaryKey(List<MetadataPropertyType>)​

View Source​
Declaration
public static MetadataPropertyType GetPrimaryKey(this List<MetadataPropertyType> props)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>props

GetId<T>(MetadataType, T)​

View Source​
Declaration
public static object GetId<T>(this MetadataType type, T model)
Returns​

System.Object

Parameters​
TypeName
ServiceStack.MetadataTypetype
<T>model
Type Parameters​
  • T

GetId<T>(List<MetadataPropertyType>, T)​

View Source​
Declaration
public static object GetId<T>(this List<MetadataPropertyType> props, T model)
Returns​

System.Object

Parameters​
TypeName
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>props
<T>model
Type Parameters​
  • T

GetValue<T>(MetadataPropertyType, T)​

View Source​
Declaration
public static object GetValue<T>(this MetadataPropertyType prop, T model)
Returns​

System.Object

Parameters​
TypeName
ServiceStack.MetadataPropertyTypeprop
<T>model
Type Parameters​
  • T

GetResponseType(Type)​

View Source​
Declaration
public static Type GetResponseType(this Type requestType)
Returns​

System.Type

Parameters​
TypeName
System.TyperequestType

ToMetadataType(Type)​

View Source​
Declaration
public static MetadataType ToMetadataType(this Type type)
Returns​

ServiceStack.MetadataType

Parameters​
TypeName
System.Typetype

ToProperties(Type, Func<PropertyInfo, MetadataPropertyType>, HashSet<Type>)​

View Source​
Declaration
public static List<MetadataPropertyType> ToProperties(Type type, Func<PropertyInfo, MetadataPropertyType> toProperty, HashSet<Type> exportTypes = null)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
System.Typetype
System.Func<System.Reflection.PropertyInfo,ServiceStack.MetadataPropertyType>toProperty
System.Collections.Generic.HashSet<System.Type>exportTypes

PopulatePrimaryKey(List<MetadataPropertyType>)​

View Source​
Declaration
public static List<MetadataPropertyType> PopulatePrimaryKey(this List<MetadataPropertyType> props)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
System.Collections.Generic.List<ServiceStack.MetadataPropertyType>props

GetAllMetadataProperties(Type)​

View Source​
Declaration
public static List<MetadataPropertyType> GetAllMetadataProperties(this Type type)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
System.Typetype

GetAllProperties(AppMetadata, String)​

View Source​
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, string typeName)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
ServiceStack.AppMetadataapi
System.StringtypeName

GetAllProperties(AppMetadata, String, String)​

View Source​
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, string namespace, string typeName)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
ServiceStack.AppMetadataapi
System.Stringnamespace
System.StringtypeName

GetAllProperties(AppMetadata, MetadataType)​

View Source​
Declaration
public static List<MetadataPropertyType> GetAllProperties(this AppMetadata api, MetadataType metaType)
Returns​

System.Collections.Generic.List<ServiceStack.MetadataPropertyType>

Parameters​
TypeName
ServiceStack.AppMetadataapi
ServiceStack.MetadataTypemetaType

GetInstancePublicProperties(Type)​

View Source​
Declaration
public static PropertyInfo[] GetInstancePublicProperties(this Type type)
Returns​

System.Reflection.PropertyInfo[]

Parameters​
TypeName
System.Typetype

ToMetadataPropertyType(PropertyInfo, Object, Dictionary<String, Object>, Boolean)​

View Source​
Declaration
public static MetadataPropertyType ToMetadataPropertyType(this PropertyInfo pi, object instance = null, Dictionary<string, object> ignoreValues = null, bool treatNonNullableRefTypesAsRequired = true)
Returns​

ServiceStack.MetadataPropertyType

Parameters​
TypeName
System.Reflection.PropertyInfopi
System.Objectinstance
System.Collections.Generic.Dictionary<System.String,System.Object>ignoreValues
System.BooleantreatNonNullableRefTypesAsRequired

PopulateInput(MetadataPropertyType, InputInfo)​

View Source​
Declaration
public static void PopulateInput(this MetadataPropertyType property, InputInfo input)
Parameters​
TypeName
ServiceStack.MetadataPropertyTypeproperty
ServiceStack.InputInfoinput

PropertyStringValue(PropertyInfo, Object, Object)​

View Source​
Declaration
public static string PropertyStringValue(this PropertyInfo pi, object instance, object ignoreIfValue = null)
Returns​

System.String

Parameters​
TypeName
System.Reflection.PropertyInfopi
System.Objectinstance
System.ObjectignoreIfValue

PropertyValueAsString(PropertyInfo, Object)​

View Source​
Declaration
public static string PropertyValueAsString(this PropertyInfo pi, object value)
Returns​

System.String

Parameters​
TypeName
System.Reflection.PropertyInfopi
System.Objectvalue

ToDataMember(DataMemberAttribute)​

View Source​
Declaration
public static MetadataDataMember ToDataMember(this DataMemberAttribute attr)
Returns​

ServiceStack.MetadataDataMember

Parameters​
TypeName
System.Runtime.Serialization.DataMemberAttributeattr

ToGenericArgs(Type)​

View Source​
Declaration
public static string[] ToGenericArgs(this Type propType)
Returns​

System.String[]

Parameters​
TypeName
System.TypepropType

GetIcon(Type)​

View Source​
Declaration
public static ImageInfo GetIcon(this Type type)
Returns​

ServiceStack.ImageInfo

Parameters​
TypeName
System.Typetype

GetIcon(MetadataType)​

View Source​
Declaration
public static ImageInfo GetIcon(this MetadataType type)
Returns​

ServiceStack.ImageInfo

Parameters​
TypeName
ServiceStack.MetadataTypetype