Class ClientObjectExtensions
Class for client object extension methods
Inheritance
System.Object
ClientObjectExtensions
Assembly: PnP.Framework.dll
Syntax
public static class ClientObjectExtensions : object
Methods
Declaration
public static void ClearObjectData(this ClientObject clientObject)
Parameters
ClientObject
clientObject
|
Ensures that particular properties are loaded on the
Declaration
public static void EnsureProperties<T>(this T clientObject, params Expression<Func<T, object>>[] propertySelector)
where T : ClientObject
Parameters
T
clientObject
|
Expression<Func<T, System.Object>>[]
propertySelector
Lamda expressions containing the properties to ensure (e.g. w => w.HasUniqueRoleAssignments, w => w.ServerRelativeUrl)
|
Type Parameters
Ensures that particular properties are loaded on the
Declaration
public static async Task EnsurePropertiesAsync<T>(this T clientObject, params Expression<Func<T, object>>[] propertySelector)
where T : ClientObject
Parameters
T
clientObject
|
Expression<Func<T, System.Object>>[]
propertySelector
Lamda expressions containing the properties to ensure (e.g. w => w.HasUniqueRoleAssignments, w => w.ServerRelativeUrl)
|
Returns
Type Parameters
Ensures that particular property is loaded on the and immediately returns this property
Declaration
public static TResult EnsureProperty<T, TResult>(this T clientObject, Expression<Func<T, TResult>> propertySelector)
where T : ClientObject
Parameters
T
clientObject
|
Expression<Func<T, TResult>>
propertySelector
Lamda expression containing the property to ensure (e.g. w => w.HasUniqueRoleAssignments)
|
Returns
Type Parameters
T
type
|
TResult
Property type
|
Ensures that particular property is loaded on the and immediately returns this property
Declaration
public static async Task<TResult> EnsurePropertyAsync<T, TResult>(this T clientObject, Expression<Func<T, TResult>> propertySelector)
where T : ClientObject
Parameters
T
clientObject
|
Expression<Func<T, TResult>>
propertySelector
Lamda expression containing the property to ensure (e.g. w => w.HasUniqueRoleAssignments)
|
Returns
Task<TResult>
Property value
|
Type Parameters
T
type
|
TResult
Property type
|
Check if a property is instantiated on a object
Declaration
public static bool IsObjectPropertyInstantiated<T>(this T clientObject, Expression<Func<T, object>> propertySelector)
where T : ClientObject
Parameters
T
clientObject
Object to operate on
|
Expression<Func<T, System.Object>>
propertySelector
Lamda expression containing the properties to check (e.g. w => w.HasUniqueRoleAssignments)
|
Returns
System.Boolean
True if the property is instantiated, false otherwise
|
Type Parameters
T
Type of object to operate on
|
Check if a property is available on a object
Declaration
public static bool IsPropertyAvailable<T>(this T clientObject, Expression<Func<T, object>> propertySelector)
where T : ClientObject
Parameters
T
clientObject
Object to operate on
|
Expression<Func<T, System.Object>>
propertySelector
Lamda expression containing the properties to check (e.g. w => w.HasUniqueRoleAssignments)
|
Returns
System.Boolean
True if the property is available, false otherwise
|
Type Parameters
T
Type of object to operate on
|
Checks if the ClientObject is null
Declaration
public static bool ServerObjectIsNull<T>(this T clientObject)
where T : ClientObject
Parameters
T
clientObject
Object to operate on
|
Returns
System.Boolean
True if the server object is null, otherwise false
|
Type Parameters
T
Type of object to operate on
|
Converts generic Expression<Func<TInput, TOutput>> to Expression with object return type - Expression<Func<TInput, object>>
Declaration
public static Expression<Func<TInput, object>> ToUntypedPropertyExpression<TInput, TOutput>(this Expression<Func<TInput, TOutput>> expression)
Parameters
Expression<Func<TInput, TOutput>>
expression
to convert
|
Returns
Expression<Func<TInput, System.Object>>
New Expression where return type is object and not generic
|
Type Parameters
TInput
Input type
|
TOutput
Returns type
|
Converts generic Expression<Func<TInput, TOutput>> to Expression with object return type - Expression<Func<TInput, object>>
Declaration
public static Expression<Func<TInput, object>> ToUntypedStaticMethodCallExpression<TInput, TOutput>(this Expression<Func<TInput, TOutput>> expression)
Parameters
Expression<Func<TInput, TOutput>>
expression
to convert
|
Returns
Expression<Func<TInput, System.Object>>
New Expression where return type is object and not generic
|
Type Parameters
TInput
Input type
|
TOutput
Returns type
|