This commit is contained in:
2020-06-26 18:22:11 +00:00
parent 1cf91e99ff
commit 3d4433d578
7 changed files with 130 additions and 12 deletions

View File

@@ -424,13 +424,13 @@ namespace AyaNova.Util
/// <param name="fileAttachmentToBeDeleted"></param>
/// <param name="ct"></param>
/// <returns></returns>
internal static async Task<FileAttachment> DeleteFileAttachmentAsync(FileAttachment fileAttachmentToBeDeleted, AyContext ct)
internal static async Task DeleteFileAttachmentAsync(FileAttachment fileAttachmentToBeDeleted, AyContext ct)
{
//check ref count of file
var count = await ct.FileAttachment.LongCountAsync(z => z.StoredFileName == fileAttachmentToBeDeleted.StoredFileName);
//Store in DB
//Remove from the DB
ct.FileAttachment.Remove(fileAttachmentToBeDeleted);
await ct.SaveChangesAsync();
@@ -448,7 +448,7 @@ namespace AyaNova.Util
}
//Return AyFileInfo object
return fileAttachmentToBeDeleted;
return;
}