Rystem.Content.Infrastructure.M365.Sharepoint 9.0.0

dotnet add package Rystem.Content.Infrastructure.M365.Sharepoint --version 9.0.0                
NuGet\Install-Package Rystem.Content.Infrastructure.M365.Sharepoint -Version 9.0.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Rystem.Content.Infrastructure.M365.Sharepoint" Version="9.0.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Rystem.Content.Infrastructure.M365.Sharepoint --version 9.0.0                
#r "nuget: Rystem.Content.Infrastructure.M365.Sharepoint, 9.0.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Rystem.Content.Infrastructure.M365.Sharepoint as a Cake Addin
#addin nuget:?package=Rystem.Content.Infrastructure.M365.Sharepoint&version=9.0.0

// Install Rystem.Content.Infrastructure.M365.Sharepoint as a Cake Tool
#tool nuget:?package=Rystem.Content.Infrastructure.M365.Sharepoint&version=9.0.0                

What is Rystem?

Get information

https://<tenant>.sharepoint.com/sites/<site-url>/_api/site/id

Integration with Sharepoint online and Content Repository

await services
.AddContentRepository()
.WithSharepointIntegrationAsync(x =>
{
    x.TenantId = configuration["Sharepoint:TenantId"];
    x.ClientId = configuration["Sharepoint:ClientId"];
    x.ClientSecret = configuration["Sharepoint:ClientSecret"];
    x.MapWithSiteNameAndDocumentLibraryName("TestNumberOne", "Foglione");
    //x.MapWithRootSiteAndDocumentLibraryName("Foglione");
    //x.MapWithSiteIdAndDocumentLibraryId(configuration["Sharepoint:SiteId"],
    //    configuration["Sharepoint:DocumentLibraryId"]);
}, "sharepoint")
.NoContext();

How to use in a business class

public class AllStorageTest
{
    private readonly IContentRepositoryFactory _contentRepositoryFactory;
    private readonly Utility _utility;
    public AllStorageTest(IContentRepositoryFactory contentRepositoryFactory, Utility utility)
    {
        _contentRepositoryFactory = contentRepositoryFactory;
        _utility = utility;
    }
    
    public async Task ExecuteAsync()
    {
        var _contentRepository = _contentRepositoryFactory.Create("sharepoint");
        var file = await _utility.GetFileAsync();
        var name = "folder/file.png";
        var contentType = "images/png";
        var metadata = new Dictionary<string, string>()
        {
            { "name", "ale" }
        };
        var tags = new Dictionary<string, string>()
        {
            { "version", "1" }
        };
        var response = await _contentRepository.ExistAsync(name).NoContext();
        if (response)
        {
            await _contentRepository.DeleteAsync(name).NoContext();
            response = await _contentRepository.ExistAsync(name).NoContext();
        }
        Assert.False(response);
        response = await _contentRepository.UploadAsync(name, file.ToArray(), new ContentRepositoryOptions
        {
            HttpHeaders = new ContentRepositoryHttpHeaders
            {
                ContentType = contentType
            },
            Metadata = metadata,
            Tags = tags
        }, true).NoContext();
        Assert.True(response);
        response = await _contentRepository.ExistAsync(name).NoContext();
        Assert.True(response);
        var options = await _contentRepository.GetPropertiesAsync(name, ContentInformationType.All).NoContext();
        Assert.NotNull(options.Uri);
        foreach (var x in metadata)
        {
            Assert.Equal(x.Value, options.Options.Metadata[x.Key]);
        }
        foreach (var x in tags)
        {
            Assert.Equal(x.Value, options.Options.Tags[x.Key]);
        }
        Assert.Equal(contentType, options.Options.HttpHeaders.ContentType);
        metadata.Add("ale2", "single");
        response = await _contentRepository.SetPropertiesAsync(name, new ContentRepositoryOptions
        {
            HttpHeaders = new ContentRepositoryHttpHeaders
            {
                ContentType = contentType
            },
            Metadata = metadata,
            Tags = tags
        }).NoContext();
        Assert.True(response);
        options = await _contentRepository.GetPropertiesAsync(name, ContentInformationType.All).NoContext();
        Assert.Equal("single", options.Options.Metadata["ale2"]);
        response = await _contentRepository.DeleteAsync(name).NoContext();
        Assert.True(response);
        response = await _contentRepository.ExistAsync(name).NoContext();
        Assert.False(response);
    }
}
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
9.0.0 12,264 11/16/2024
9.0.0-rc.1 71 10/18/2024
6.2.0 218,972 10/9/2024
6.1.1 79 10/9/2024
6.1.0 47,831 9/29/2024
6.0.24 102 9/11/2024
6.0.23 339,985 7/18/2024
6.0.21 102 6/18/2024
6.0.20 727,690 6/16/2024
6.0.19 30,363 6/14/2024
6.0.18 95 6/14/2024
6.0.17 92 6/14/2024
6.0.16 49,950 6/10/2024
6.0.15 102 6/9/2024
6.0.14 94,444 5/24/2024
6.0.13 102 5/23/2024
6.0.12 91 5/23/2024
6.0.11 113 5/20/2024
6.0.9 116 5/20/2024
6.0.7 100 5/18/2024
6.0.6 96 5/10/2024
6.0.5 100 5/10/2024
6.0.4 549,991 4/3/2024
6.0.3 159 3/25/2024
6.0.2 172 3/11/2024
6.0.0 213 11/21/2023
6.0.0-rc.6 90 10/25/2023
6.0.0-rc.5 69 10/25/2023
6.0.0-rc.4 63 10/23/2023
6.0.0-rc.3 59 10/19/2023
6.0.0-rc.2 67 10/18/2023
6.0.0-rc.1 62 10/16/2023
5.0.20 152 9/25/2023
5.0.19 180 9/10/2023
5.0.18 162 9/6/2023
5.0.17 136 9/6/2023
5.0.16 158 9/5/2023
5.0.15 166 9/5/2023
5.0.14 164 9/5/2023
5.0.13 138 9/1/2023
5.0.12 166 8/31/2023
5.0.11 158 8/30/2023
5.0.10 166 8/29/2023
5.0.9 161 8/24/2023
5.0.8 167 8/24/2023
5.0.7 164 8/23/2023
5.0.6 155 8/21/2023
5.0.5 187 8/21/2023
5.0.4 162 8/16/2023
5.0.3 203 8/2/2023
5.0.2 189 8/2/2023
5.0.1 193 8/1/2023
5.0.0 205 7/31/2023
4.0.6 204 7/20/2023
4.0.4 239 7/10/2023
4.0.3 176 7/10/2023
4.0.0 185 7/9/2023