17 lines
976 B
C#
17 lines
976 B
C#
using MeetTheTeacher.Model;
|
|
|
|
namespace MeetTheTeacher.Export;
|
|
|
|
/// <summary>
|
|
/// Default implementation of <see cref="IExporterProvider"/> which returns the following exporters:
|
|
/// <see cref="CsvDataExporter"/> and <see cref="HtmlDataExporter"/>
|
|
/// </summary>
|
|
public sealed class DefaultExporterProvider : IExporterProvider
|
|
{
|
|
public IDataExporter GetExporter(ExportFormat exportFormat) => exportFormat switch
|
|
{
|
|
ExportFormat.Csv => new CsvDataExporter(),
|
|
ExportFormat.Html => new HtmlDataExporter(),
|
|
_ => throw new ArgumentOutOfRangeException(nameof(exportFormat), exportFormat, "Unsupported export format")
|
|
};
|
|
}
|