/// <summary> /// 执行 /// </summary> /// <param name="level">日志级别</param> /// <param name="content">日志内容</param> protected virtual void Execute(LogLevel level, ref TContent content) { if (content == null) return; if (Enabled(level) == false) return; try { content.Level = Enum.GetName<LogLevel>(level); Init(content); Provider.WriteLog(level, content); } finally { content = null; } }
public void Test_GetName_Nullable(object member, string name) { Assert.Equal(name, Enum.GetName <EnumSample?>(member)); }
public void Test_GetName_Validate() { Assert.Equal(string.Empty, Enum.GetName(typeof(Sample), 3)); }