Search Results for

    Show / Hide Table of Contents

    Interface IFileCollection

    Public interface to define a collection of File objects

    Inherited Members
    IDataModelParent.Parent
    IDataModelWithContext.PnPContext
    IRequestableCollection.Requested
    IRequestableCollection.Length
    IRequestableCollection.RequestedItems
    IRequestableCollection.Clear()
    IDataModelCollectionLoad<IFile>.LoadAsync(Expression<Func<IFile, Object>>[])
    IDataModelCollectionLoad<IFile>.LoadBatchAsync(Batch, Expression<Func<IFile, Object>>[])
    IDataModelCollectionDeleteByGuidId.DeleteById(Guid)
    IDataModelCollectionDeleteByGuidId.DeleteByIdAsync(Guid)
    IDataModelCollectionDeleteByGuidId.DeleteByIdBatch(Guid)
    IDataModelCollectionDeleteByGuidId.DeleteByIdBatchAsync(Guid)
    IDataModelCollectionDeleteByGuidId.DeleteByIdBatch(Batch, Guid)
    IDataModelCollectionDeleteByGuidId.DeleteByIdBatchAsync(Batch, Guid)
    Namespace: PnP.Core.Model.SharePoint
    Assembly: PnP.Core.dll
    Syntax
    public interface IFileCollection : IDataModelCollection<IFile>, IDataModelParent, IDataModelWithContext, IRequestableCollection, IDataModelCollectionLoad<IFile>, IDataModelCollectionDeleteByGuidId, ISupportModules<IFileCollection>

    Methods

    Add(String, Stream, Boolean)

    Add a file to the file collection using batching (sync)

    Declaration
    IFile Add(string name, Stream content, bool overwrite = false)
    Parameters
    System.String name

    The name of the file.

    Stream content

    The content of the file.

    System.Boolean overwrite

    Indicates whether the file should be overwritten if already existing.

    Returns
    IFile

    The added file object.

    AddAsync(String, Stream, Boolean)

    Add a file to the file collection using batching (async)

    Declaration
    Task<IFile> AddAsync(string name, Stream content, bool overwrite = false)
    Parameters
    System.String name

    The name of the file.

    Stream content

    The content of the file.

    System.Boolean overwrite

    Indicates whether the file should be overwritten if already existing.

    Returns
    Task<IFile>

    The added file object.

    AddTemplateFile(String, TemplateFileType)

    Adds a file based upon an out of the box template

    Declaration
    IFile AddTemplateFile(string serverRelativePageName, TemplateFileType templateFileType)
    Parameters
    System.String serverRelativePageName

    Server relative url of the page to add

    TemplateFileType templateFileType

    Type of template file to add

    Returns
    IFile

    The added IFile

    AddTemplateFileAsync(String, TemplateFileType)

    Adds a file based upon an out of the box template

    Declaration
    Task<IFile> AddTemplateFileAsync(string serverRelativePageName, TemplateFileType templateFileType)
    Parameters
    System.String serverRelativePageName

    Server relative url of the page to add

    TemplateFileType templateFileType

    Type of template file to add

    Returns
    Task<IFile>

    The added IFile

    Extension Methods

    DataModelCollectionLoadExtensions.LoadBatchAsync<TModel>(IDataModelCollectionLoad<TModel>, Expression<Func<TModel, Object>>[])
    DataModelCollectionLoadExtensions.LoadBatchAsync<TModel>(IDataModelCollectionLoad<TModel>, Batch, Expression<Func<TModel, Object>>[])
    DataModelCollectionLoadExtensions.LoadBatch<TModel>(IDataModelCollectionLoad<TModel>, Batch, Expression<Func<TModel, Object>>[])
    DataModelCollectionLoadExtensions.LoadBatch<TModel>(IDataModelCollectionLoad<TModel>, Expression<Func<TModel, Object>>[])
    DataModelCollectionLoadExtensions.Load<TModel>(IDataModelCollectionLoad<TModel>, Expression<Func<TModel, Object>>[])
    RequestModuleExtensions.WithHeaders<TModel>(ISupportModules<TModel>, Dictionary<String, String>, Action<Dictionary<String, String>>)
    RequestModuleExtensions.WithResponseHeaders<TModel>(ISupportModules<TModel>, Action<Dictionary<String, String>>)
    QueryableExtensions.AsRequested<TSource>(IDataModelCollection<TSource>)
    Back to top PnP Core SDK
    Generated by DocFX with Material UI
    spacer