forked from ssannandeji/Zenject-2019
-
Notifications
You must be signed in to change notification settings - Fork 299
Open
Description
I would have asked in the discord, but the invite link is expired.
I would just like to know if it's possible to handle generics for installers (This compiles but I can't attach as a component)?
public class RequestInstaller<TRequest, TResponse> : MonoInstaller
{
public override void InstallBindings()
{
Container.Bind<IRequestSystem<TRequest, TResponse>>().To<RequestSystem<TRequest, TResponse>>().AsSingle();
}
}
https://github.com/modesttree/Zenject?tab=readme-ov-file#runtime-parameters-for-installers covers params but not generics, I'm looking to make a generic HTTP request / response class.
public interface IRequestSystem<TRequest, TResponse>
{
Task<TResponse> RequestAsync(Endpoints endpoint, TRequest requestData);
}
public class RequestSystem<TRequest, TResponse> : IRequestSystem<TRequest, TResponse>
...
Metadata
Metadata
Assignees
Labels
No labels