42 lines
933 B
C#
42 lines
933 B
C#
using Microsoft.Extensions.Configuration;
|
|
using System.Text.Json;
|
|
|
|
namespace Mesa_Backlog.Library.Binder;
|
|
|
|
public class Excel
|
|
{
|
|
|
|
#nullable disable
|
|
|
|
public string Sheet { get; set; }
|
|
public string SourceFile { get; set; }
|
|
public string TargetFile { get; set; }
|
|
|
|
#nullable restore
|
|
|
|
public override string ToString()
|
|
{
|
|
string result = JsonSerializer.Serialize(this, new JsonSerializerOptions() { WriteIndented = true });
|
|
return result;
|
|
}
|
|
|
|
private static Library.Excel Get(Excel excel)
|
|
{
|
|
Library.Excel result;
|
|
result = new(
|
|
excel.Sheet,
|
|
excel.SourceFile,
|
|
excel.TargetFile
|
|
);
|
|
return result;
|
|
}
|
|
|
|
public static Library.Excel Get(IConfigurationRoot configurationRoot)
|
|
{
|
|
Library.Excel result;
|
|
Excel excel = configurationRoot.Get<Excel>();
|
|
result = Get(excel);
|
|
return result;
|
|
}
|
|
|
|
} |