Files
Disco/Disco.Services/Exporting/IExport.cs
T
2025-02-14 13:07:30 +11:00

38 lines
1021 B
C#

using Disco.Data.Repository;
using Disco.Models.Exporting;
using Disco.Models.Services.Exporting;
using Disco.Services.Tasks;
using System;
using System.Collections.Generic;
using System.Text.Json.Serialization;
namespace Disco.Services.Exporting
{
public interface IExport
{
Guid Id { get; set; }
[JsonIgnore]
string Name { get; }
ExportResult Export(DiscoDataContext database, IScheduledTaskStatus status);
}
public interface IExport<T, R>
: IExport
where T : IExportOptions, new()
where R : IExportRecord
{
[JsonIgnore]
string FilenamePrefix { get; }
[JsonIgnore]
string ExcelWorksheetName { get; }
[JsonIgnore]
string ExcelTableName { get; }
T Options { get; set; }
List<R> BuildRecords(DiscoDataContext database, IScheduledTaskStatus status);
ExportMetadata<T, R> BuildMetadata(DiscoDataContext database, List<R> records, IScheduledTaskStatus status);
}
}