C#C
C#4y ago
florent

Named tuple on delegate return type [Answered]

I've defined a delegate like this:
public delegate Task<Tuple<TEntity, bool>> AddUpdateCallbackDelegate(TEntity entity, IEnumerable<TEntity> dataSource);
public AddUpdateCallbackDelegate OnAddCallback { get; set; }

...
public async Task Test()
{
    var res = await OnAddCallback(...);
    res.Item1...
    res.Item2...
}

the return type etc. works just fine, but I want to name the tuple parameters instead of the default Item1/2. How could I do that?
Was this page helpful?