Class RequestFactory<T>
An abstract base class that implements IRequestFactory for creating requests of type T.
public abstract class RequestFactory<T> : IRequestFactory where T : IRequest, new()
Type Parameters
| Name | Type | Description |
|---|---|---|
T | The type of request to create. Must implement IRequest and have a parameterless constructor. |
Inheritance
Implements
Methods
CreateRequest()
Creates a new instance of type T.
public virtual IRequest CreateRequest()
Returns
IRequest — A new instance of T.
CreateRequest(string, string)
Creates a new instance of type T using the provided name and data.
public abstract IRequest CreateRequest(string name, string data)
Parameters
| Name | Type | Description |
|---|---|---|
name | string | The name to associate with the request. |
data | string | The data payload for the request. |
Returns
IRequest — A new instance of T initialized with the given parameters.