Hi all
I've just come across this and can work out what the "Task<long?>" mean. Has anyone got an explanation or can point me to somewhere that explains it.
Thanks
Hi all
I've just come across this and can work out what the "Task<long?>" mean. Has anyone got an explanation or can point me to somewhere that explains it.
Thanks
See MSDN documentation of System.Threading.Tasks.Task<TResult>
:
long?
is the type parameter, which is a nullable long. It could be written as
Task<Nullable<long>>
I'm not sure which part of Task<long?>
you don't get, so:
Task<T>
is a generic class used within Task Parallel Library to represent asynchronous operation.
long?
is a shortcut for Nullable<long>
: ? (nullable) operator in C#
You would want to read up on Generics in the .NET Framework. Basically, generics are a way to create parametrized types. In your example there's a generic type Task<T>
, which is parametrized with long?
, which is a nullable long value.