I've got a few gRPC services that all share a common method and was hoping to be able to do something like this:
[Service]
public interface IVehicleReloader<T> where T : IVehicle
{
public ValueTask<T> ReloadInstance(ReloadInstanceRequest path);
}
[Service]
public interface ICarService : IVehicleReloader<Car>
{
...
}
[Service]
public interface IMotorbike : IVehicleReloader<Motorbike>
{
...
}
But this won't even compile, it straight up says The gRPC service cannot be generic.
Is there any other way of achieving this, short of having to declare the method on each of the interfaces?