Implement file upload
This commit is contained in:
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user