Interface IFileCollection
- Namespace
- PnP.Core.Model.SharePoint
- Assembly
- PnP.Core.dll
Public interface to define a collection of File objects
public interface IFileCollection : IQueryable<IFile>, IQueryable, IAsyncEnumerable<IFile>, IDataModelCollection<IFile>, IEnumerable<IFile>, IEnumerable, IDataModelParent, IDataModelWithContext, IRequestableCollection, IDataModelCollectionLoad<IFile>, IDataModelCollectionDeleteByGuidId, ISupportModules<IFileCollection>
- Inherited Members
- Extension Methods
Methods
Add(string, Stream, bool)
Add a file to the file collection using batching (sync)
IFile Add(string name, Stream content, bool overwrite = false)
Parameters
namestringThe name of the file.
contentStreamThe content of the file.
overwriteboolIndicates whether the file should be overwritten if already existing.
Returns
- IFile
The added file object.
AddAsync(string, Stream, bool)
Add a file to the file collection using batching (async)
Task<IFile> AddAsync(string name, Stream content, bool overwrite = false)
Parameters
namestringThe name of the file.
contentStreamThe content of the file.
overwriteboolIndicates whether the file should be overwritten if already existing.
Returns
AddTemplateFile(string, TemplateFileType)
Adds a file based upon an out of the box template
IFile AddTemplateFile(string serverRelativePageName, TemplateFileType templateFileType)
Parameters
serverRelativePageNamestringServer relative url of the page to add
templateFileTypeTemplateFileTypeType of template file to add
Returns
AddTemplateFileAsync(string, TemplateFileType)
Adds a file based upon an out of the box template
Task<IFile> AddTemplateFileAsync(string serverRelativePageName, TemplateFileType templateFileType)
Parameters
serverRelativePageNamestringServer relative url of the page to add
templateFileTypeTemplateFileTypeType of template file to add