From 22a71271e44e94eb361a843e6ec055de28bcc619 Mon Sep 17 00:00:00 2001 From: Josh Creek Date: Sun, 29 Aug 2021 23:05:36 +0100 Subject: [PATCH] feat(*): Add documentation to File model to remove warnings --- FileRepository/Models/File.cs | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/FileRepository/Models/File.cs b/FileRepository/Models/File.cs index 05a4548..a9f2a29 100644 --- a/FileRepository/Models/File.cs +++ b/FileRepository/Models/File.cs @@ -1,17 +1,40 @@ using System; -using System.Collections.Generic; using System.IO; -using System.Text; namespace FileRepository.Models { + /// + /// This model serves to represent the files being stored. + /// public class File { + /// + /// Gets or sets the id field for the file, this serves as the key field/unique identifier. + /// public string Id { get; set; } + + /// + /// Gets or sets the actual file name of the file. + /// public string FileName { get; set; } + + /// + /// Gets or sets the contents of the file, as a stream for easy manipulation. + /// public Stream Content { get; set; } + + /// + /// Gets or sets the datetime object representing when this file object was created. + /// public DateTime Created { get; set; } + /// + /// Initialise a File model based on passed parameters. + /// + /// The id of the file. + /// The filename of the file. + /// The content of the file. + /// Returns an initialised File object. public File GenerateFile(string id, string fileName, Stream content) { File newFile = new File() @@ -19,7 +42,7 @@ namespace FileRepository.Models Id = id, FileName = fileName, Content = content, - Created = DateTime.Now + Created = DateTime.Now, }; return newFile;