Interface IDataModel<TModel>
Defines the very basic interface for every Domain Model object. Add methods are implemented in their respective model interfaces
Namespace: PnP.Core.Model
Assembly: PnP.Core.dll
Syntax
public interface IDataModel<TModel> : IDataModelParent, IDataModelWithContext, ISupportModules<TModel>
Type Parameters
TModel
The actual type of the Domain Model object |
Properties
Requested
Defines whether this model object was requested from the back-end
Declaration
bool Requested { get; set; }
Property Value
System.Boolean
|
Methods
ArePropertiesAvailable(Expression<Func<TModel, Object>>[])
Checks if the needed properties were loaded or not
Declaration
bool ArePropertiesAvailable(params Expression<Func<TModel, object>>[] expressions)
Parameters
Expression<Func<TModel, System.Object>>[]
expressions
Expression listing the properties to check |
Returns
System.Boolean
True if properties were loaded, false otherwise |
EnsureProperties(Expression<Func<TModel, Object>>[])
Checks if the requested properties are loaded for the given model, if not they're loaded right now
Declaration
void EnsureProperties(params Expression<Func<TModel, object>>[] expressions)
Parameters
Expression<Func<TModel, System.Object>>[]
expressions
Expressions listing the properties to load |
EnsurePropertiesAsync(Expression<Func<TModel, Object>>[])
Checks if the requested properties are loaded for the given model, if not they're loaded via a GetAsync call
Declaration
Task EnsurePropertiesAsync(params Expression<Func<TModel, object>>[] expressions)
Parameters
Expression<Func<TModel, System.Object>>[]
expressions
Expressions listing the properties to load |
Returns
Task
|
ExecuteRequest(ApiRequest)
Executes a given API call
Declaration
ApiRequestResponse ExecuteRequest(ApiRequest request)
Parameters
ApiRequest
request
API call to execute |
Returns
ApiRequestResponse
The response of the API call |
ExecuteRequestAsync(ApiRequest)
Executes a given API call
Declaration
Task<ApiRequestResponse> ExecuteRequestAsync(ApiRequest request)
Parameters
ApiRequest
request
API call to execute |
Returns
Task<ApiRequestResponse>
The response of the API call |
ExecuteRequestBatch(ApiRequest)
Executes a given API call
Declaration
IBatchSingleResult<BatchResultValue<string>> ExecuteRequestBatch(ApiRequest request)
Parameters
ApiRequest
request
API call to execute |
Returns
IBatchSingleResult<BatchResultValue<System.String>>
The response of the API call |
ExecuteRequestBatch(Batch, ApiRequest)
Executes a given API call
Declaration
IBatchSingleResult<BatchResultValue<string>> ExecuteRequestBatch(Batch batch, ApiRequest request)
Parameters
Batch
batch
|
ApiRequest
request
API call to execute |
Returns
IBatchSingleResult<BatchResultValue<System.String>>
The response of the API call |
ExecuteRequestBatchAsync(ApiRequest)
Executes a given API call
Declaration
Task<IBatchSingleResult<BatchResultValue<string>>> ExecuteRequestBatchAsync(ApiRequest request)
Parameters
ApiRequest
request
API call to execute |
Returns
Task<IBatchSingleResult<BatchResultValue<System.String>>>
The response of the API call |
ExecuteRequestBatchAsync(Batch, ApiRequest)
Executes a given API call
Declaration
Task<IBatchSingleResult<BatchResultValue<string>>> ExecuteRequestBatchAsync(Batch batch, ApiRequest request)
Parameters
Batch
batch
|
ApiRequest
request
API call to execute |
Returns
Task<IBatchSingleResult<BatchResultValue<System.String>>>
The response of the API call |
HasChanged(String)
Checks if a property on this model object has changed
Declaration
bool HasChanged(string propertyName = "")
Parameters
System.String
propertyName
Property to check |
Returns
System.Boolean
True if changed, false otherwise |
HasValue(String)
Checks if a property on this model object has a value set
Declaration
bool HasValue(string propertyName = "")
Parameters
System.String
propertyName
Property to check |
Returns
System.Boolean
True if set, false otherwise |
IsPropertyAvailable(Expression<Func<TModel, Object>>)
Checks if a property is loaded or not
Declaration
bool IsPropertyAvailable(Expression<Func<TModel, object>> expression)
Parameters
Expression<Func<TModel, System.Object>>
expression
Expression listing the property to load |
Returns
System.Boolean
True if property was loaded, false otherwise |