Implement file upload

This commit is contained in:
2025-11-20 09:55:57 +09:00
parent 7c5c889c53
commit 5b3cb2cabd
9 changed files with 128 additions and 16 deletions

View File

@ -10,5 +10,21 @@ namespace Hcs.WebApp.Services
using var context = GetNewContext();
return await context.FilesToParse.ToListAsync();
}
public async Task<FileToParse> AddFileToParseAsync(string path, string fileName, string uploaderId, DateTime uploadedAt)
{
using var context = GetNewContext();
var fileToParse = new FileToParse()
{
Path = path,
FileName = fileName,
UploaderId = uploaderId,
UploadedAt = uploadedAt
};
await context.FilesToParse.AddAsync(fileToParse);
await context.SaveChangesAsync();
return fileToParse;
}
}
}