mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-30 23:02:50 +08:00
20 lines
414 B
C#
20 lines
414 B
C#
using System;
|
|
using System.Diagnostics;
|
|
|
|
namespace Spectre.Console
|
|
{
|
|
public static class ShouldlyExtensions
|
|
{
|
|
[DebuggerStepThrough]
|
|
public static T And<T>(this T item, Action<T> action)
|
|
{
|
|
if (action == null)
|
|
{
|
|
throw new ArgumentNullException(nameof(action));
|
|
}
|
|
|
|
action(item);
|
|
return item;
|
|
}
|
|
}
|
|
} |