using Hcs.WebApp.Data.Hcs; using Microsoft.EntityFrameworkCore; namespace Hcs.WebApp.Services { public class FileToParseService(IDbContextFactory factory) : HcsServiceBase(factory) { public async Task> GetAllFilesToParseAsync() { using var context = GetNewContext(); return await context.FilesToParse.ToListAsync(); } public async Task 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; } } }