using Elwig.Models.Dtos; using Elwig.Models.Entities; using System; using System.Collections.Generic; using System.Threading.Tasks; namespace Elwig.Helpers.Export { public class MemberMovement : IExporter { public static string FileExtension => "ods"; private readonly OdsFile _ods; public MemberMovement(string filename) { _ods = new OdsFile(filename); } public void Dispose() { GC.SuppressFinalize(this); _ods.Dispose(); } public async Task ExportAsync(IEnumerable data, IProgress? progress = null) { using var ctx = new AppDbContext(); var tbl = MemberMovementData.FromMemberHistory("", data, await ctx.GetMemberHistory()); await _ods.AddTable(tbl); } } }