mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-23 16:14:11 +00:00
23 lines
518 B
C#
23 lines
518 B
C#
namespace Lantean.QBTMud.Models
|
|
{
|
|
public record RowContext<T>
|
|
{
|
|
private readonly Func<T, object?> _valueGetter;
|
|
|
|
public RowContext(string headerText, T data, Func<T, object?> valueGetter)
|
|
{
|
|
HeaderText = headerText;
|
|
Data = data;
|
|
_valueGetter = valueGetter;
|
|
}
|
|
|
|
public string HeaderText { get; }
|
|
|
|
public T Data { get; set; }
|
|
|
|
public object? GetValue()
|
|
{
|
|
return _valueGetter(Data);
|
|
}
|
|
}
|
|
} |