Releases: tommasobertoni/IsAwaitable
Releases · tommasobertoni/IsAwaitable
v1.3.1
v1.3.0
Introduces Awaitable
and AwaitableDescription
:
using IsAwaitable.Analysis;
_ = Awaitable.Describe("hello");
// null
var description = Awaitable.Describe(typeof(MyCustomAwaitableType));
if (description is not null)
{
var resultType = description.ResultType;
}
var taskDescription = Awaitable.Describe<Task>();
var isKnownAwaitable = taskDescripti.IsKnownAwaitable;
v1.2.0
Introduce methods that also return the Type
of the result:
using System.Threading.Tasks;
bool IsAwaitableWithResult(this object instance, out Type resultType);
bool IsAwaitableWithResult(this Type type, out Type resultType);
using IsAwaitable;
bool IsKnownAwaitableWithResult(this object? instance, out Type resultType);
bool IsKnownAwaitableWithResult(this Type type, out Type resultType);
Targets netstandard2.0.
v1.1.0
Added extension method for checking if a type or instance is both awaitable and returns a result:
bool IsAwaitableWithResult(this object? instance);
bool IsAwaitableWithResult(this Type type);
v1.0.1
Improved evaluation performances by using a cache and known types short-circuit.
v1.0.0
Provides extension method IsAwaitable
returning true
when the instance or type definition can be awaited.
The algorithm follows the c# language specification for awaitable expressions.