0

Noob question here, but I've been unable to find in official documentation what <Tdata> is in C#? I was watching this talk on railway oriented programming in C# which also mentions <Terror> and <Tsuccess> which I have been unable to find any documentation on as well: https://www.youtube.com/watch?v=45yk2nuRjj8

For next time I run into an unknown data type like this, where is the appropriate place to look in the docs? I've been looking here: https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/value-types

Thanks!

David Mays
  • 466
  • 4
  • 14
  • 3
    That's what's known as a "type parameter". It's not an actual type. Learning about [generics in C#](https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/types/generics) will help you understand more about how to work with type parameters. Generally "T" is the generic type parameter, but sometimes we get more specific when naming type parameters, and assign a name like "TData". This is particularly help if there's multiple generic type parameters. The convention is that a generic type parameter starts with a "T", but there's nothing stopping you from not following the convention. – mason Apr 22 '22 at 19:50
  • 1
    For example, [System.Collections.Generic.Dictionary](https://learn.microsoft.com/en-us/dotnet/api/system.collections.generic.dictionary-2) has TKey and TData type parameters. – mason Apr 22 '22 at 19:53

0 Answers0