What you want to achieve is not possible.
What I reccommend you to do is create a scoped per option that you have. But istead of passing a parameter as a dynamic string you will need to pass a class, one per each dynamic-parameter, not sure if will be good for your use case.
public class IdClass1 : ParentClassWithId
{}
public class IdClass2 : ParentClassWithId
{}
public class ParentClassWithId
{
public string Id { get; set; }
}
then your IOrganizationIdProvider it will become IOrganizationIdProvider<T> where T is this class.
public interface IOrganizationIdProvider<T>
{
//code
}
For reusable code, convert your main OrganizationProvider class to abstract
public abstract class OrganizationProvider<T>
{
}
and then for each one of the "dynamic" you need a class to use it:
public class OrganizationIdProvider1<T> : OrganizationProvider<T>, IOrganizationIdProvider<T>
{
//Code
}
public class OrganizationIdProvider2<T> : OrganizationProvider<T>, IOrganizationIdProvider<T>
{
//Code
}
in you initial dependency injection you will need to declare all of the possibilites, on this example:
scope.AddScoped<IOrganizationIdProvider<IdClass2>, OrganizationIdProvider2<IdClass2>>()
.AddScoped<IOrganizationIdProvider<IdClass1>, OrganizationIdProvider1<IdClass1>>();
and you will need some logic around to get the correct Interface, but this may solve your problem.