在C#中是否有相当于这个接口?
例:
Consumer<Byte> consumer = new Consumer<>();
consumer.accept(data[11]);
Run Code Online (Sandbox Code Playgroud)
我四处搜寻Func<>,Action<>但我不知道.
Consumer.accept()接口的原始Java代码非常简单.但不适合我:
void accept(T t);
/**
* Returns a composed {@code Consumer} that performs, in sequence, this
* operation followed by the {@code after} operation. If performing either
* operation throws an exception, it is relayed to the caller of the
* composed operation. If performing this operation throws an exception,
* the {@code after} operation will not be performed.
*
* @param after the operation to …Run Code Online (Sandbox Code Playgroud)