Template10.Services.FileService 1.0.1

dotnet add package Template10.Services.FileService --version 1.0.1                
NuGet\Install-Package Template10.Services.FileService -Version 1.0.1                
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="Template10.Services.FileService" Version="1.0.1" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Template10.Services.FileService --version 1.0.1                
#r "nuget: Template10.Services.FileService, 1.0.1"                
#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 Template10.Services.FileService as a Cake Addin
#addin nuget:?package=Template10.Services.FileService&version=1.0.1

// Install Template10.Services.FileService as a Cake Tool
#tool nuget:?package=Template10.Services.FileService&version=1.0.1                

FileService

FileService simplifies the common ways of interacting with files by abstracting the storage types to Local, Roaming and Temporary. In doing so, the service takes care of correctly creating the appropriate paths. All storage strategies are within the app's own data directory. All calls that allow a storage strategy to be specified default to local storage.

// Deletes a file in the specified storage strategy. key is the path of the file in storage. This
// is safe to call even if the file doesn't exist already. Returns true if the deletion operation
// was successful (i.e. the file doesn't exist).
async Task<bool> DeleteFileAsync(string key, StorageStrategies location = StorageStrategies.Local)

// This checks for the existence of a file, either in the specified storage strategy or in the
// specified folder.
async Task<bool> FileExistsAsync(string key, StorageStrategies location = StorageStrategies.Local)
async Task<bool> FileExistsAsync(string key, StorageFolder folder)

// ReadFileAsync reads and deserializes a file into specified type T. T specifies the type into which
// to deserialize the file content while key is the path to the file within the specified storage strategy.
async Task<T> ReadFileAsync<T>(string key, StorageStrategies location = StorageStrategies.Local)

// WriteFileAsync serializes an object (of specified type T) and writes it to file in the specified storage
// strategy. Key specifies the path to the file within the storage strategy. You can also alter the behaviour
// if the code if the destination file already exists. The method returns a boolean to indicate whether or not
// the file exists.
async Task<bool> WriteFileAsync<T>(string key, T value, StorageStrategies location = StorageStrategies.Local,
            CreationCollisionOption option = CreationCollisionOption.ReplaceExisting)
Product Compatible and additional computed target framework versions.
Universal Windows Platform uap10.0.16299 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Template10.Services.FileService:

Package Downloads
Template10.Services.NagService

Handy Nag Service for WinRT. Part of Template 10, a Library of Helpers for UWP.

GitHub repositories (1)

Showing the top 1 popular GitHub repositories that depend on Template10.Services.FileService:

Repository Stars
Windows-XAML/Template10
Making Windows 10 apps great again
Version Downloads Last updated
1.0.1 2,926 10/5/2019 1.0.1 is deprecated because it is no longer maintained.
1.0.0 970 9/28/2019