Summary
Gets the data of the specified type.
- Namespace
- Cake
.Core - Containing Type
- ICakeDataResolver
Syntax
TData Get<TData>() where TData : class
Examples
Setup<Foo>(context => new Foo { Place = "World" });
Task("Hello")
.Does(context =>
{
var data = context.Data.Get<Foo>();
Information("Hello {0}", data.Place);
});
Type Parameters
| Name | Description |
|---|---|
| TData | The data type. |
Return Value
| Type | Description |
|---|---|
| TData | The value of the data. |
