using Hotline.Share.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace Hotline.Share.Tools;
public static class MethodInfoExtensions
{

    public static string GetFileName(this MethodInfo? value)
    {
        if (value == null) return string.Empty;
        var att = value.GetCustomAttribute<ExportExcelAttribute>();
        if (att == null) return string.Empty;
        return att.FileName;
    }

    public static string? GetTotalName(this MethodInfo? value)
    {
        if (value == null) return string.Empty;
        var att = value.GetCustomAttribute<ExportExcelAttribute>();
        if (att == null) return null;
        return att.TotalName;
    }
}
