From 11450dedcdc430bcdde7e5b66b628cb083f2cc76 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Sun, 29 Aug 2021 23:16:07 +0100 Subject: [PATCH] feat(*): Add IFileRepository --- FileRepository/IFileRepository.cs | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 FileRepository/IFileRepository.cs diff --git a/FileRepository/IFileRepository.cs b/FileRepository/IFileRepository.cs new file mode 100644 index 0000000..9764eef --- /dev/null +++ b/FileRepository/IFileRepository.cs @@ -0,0 +1,41 @@ +using FileRepository.Models; +using System; +using System.IO; +using System.Threading.Tasks; + +namespace FileRepository +{ + /// + /// A repository interface to ensure that all storage repositories implement all the required methods, and that the methods are all generic. + /// + public interface IFileRepository + { + /// + /// Create a file in the repository. + /// + /// The file to store. + /// Returns a string id of the created file. + Task CreateFileAsync(RepoFile file); + + /// + /// Read a file from the repository. + /// + /// The id of the file to read. + /// Returns the file from the repository. + Task ReadFileAsync(string id); + + /// + /// Update a file in the repository. + /// + /// The id of the file to update. + /// Returns a boolean representing whether or not the update was successful. + Task UpdateFileAsync(string id); + + /// + /// Delete a file in the repository. + /// + /// The id of the file to delete. + /// Returns a boolean representing whether or not the delete was successful. + Task DeleteFileAsync(string id); + } +}