Exemple #1
0
        /// <summary>
        /// Loads a Domain Model object from the remote data source, eventually selecting custom properties or using a default set of properties
        /// </summary>
        /// <param name="dataModelLoad"></param>
        /// <param name="expressions">The properties to select</param>
        /// <returns>The Domain Model object</returns>
        public static void Load <TModel>(this IDataModelLoad <TModel> dataModelLoad, params Expression <Func <TModel, object> >[] expressions)
        {
            if (dataModelLoad == null)
            {
                throw new ArgumentNullException(nameof(dataModelLoad));
            }

            dataModelLoad.LoadAsync(expressions).GetAwaiter().GetResult();
        }
Exemple #2
0
        /// <summary>
        /// Batches the load of a Domain Model object from the remote data source, eventually selecting custom properties or using a default set of properties
        /// </summary>
        /// <param name="dataModelLoad"></param>
        /// <param name="expressions">The properties to select</param>
        /// <returns>The Domain Model object</returns>
        public static Task <IBatchResult> LoadBatchAsync <TModel>(this IDataModelLoad <TModel> dataModelLoad, params Expression <Func <TModel, object> >[] expressions)
        {
            if (dataModelLoad == null)
            {
                throw new ArgumentNullException(nameof(dataModelLoad));
            }

            return(dataModelLoad.LoadBatchAsync(null, expressions));
        }
Exemple #3
0
        /// <summary>
        /// Batches the load of a Domain Model object from the remote data source, eventually selecting custom properties or using a default set of properties
        /// </summary>
        /// <param name="dataModelLoad"></param>
        /// <param name="batch">Batch add this request to</param>
        /// <param name="expressions">The properties to select</param>
        /// <returns>The Domain Model object</returns>
        public static IBatchResult LoadBatch <TModel>(this IDataModelLoad <TModel> dataModelLoad, Batch batch, params Expression <Func <TModel, object> >[] expressions)
        {
            if (dataModelLoad == null)
            {
                throw new ArgumentNullException(nameof(dataModelLoad));
            }

            return(dataModelLoad.LoadBatchAsync(batch, expressions).GetAwaiter().GetResult());
        }
Exemple #4
0
        /// <summary>
        /// Loads a Domain Model object from the remote data source, eventually selecting custom properties or using a default set of properties
        /// </summary>
        /// <param name="dataModel"></param>
        /// <param name="expressions">The properties to select</param>
        /// <returns>The Domain Model object</returns>
#pragma warning disable CA1801  // Review unused parameters
#pragma warning disable IDE0060 // Remove unused parameter
        public static TModel QueryProperties <TModel>(this IDataModelLoad <TModel> dataModel, params Expression <Func <TModel, object> >[] expressions)
#pragma warning restore IDE0060 // Remove unused parameter
#pragma warning restore CA1801  // Review unused parameters
        {
            throw new InvalidOperationException(PnPCoreResources.Exception_Unsupported_QueryPropertiesUse);
        }