我是C#的新手,我面对一个具有以下结构的类:
public class SimpleGetter<TSubs> : GetterBase<TSubs>, ISubscriptionsSingleGetter<TSubs>
where TSubs : class, ISimpleSubscription, new()
{
UserSubscriptionsResponse<TSubs> ISubscriptionsSingleGetter<TSubs>.Get()
{
return ((ISubscriptionsSingleGetter<TSubs>)this).Get(null);
}
UserSubscriptionsResponse<TSubs> ISubscriptionsSingleGetter<TSubs>.Get(string userId)
{
return GetSubsResponse(userId);
}
}
我需要将userID传递到get()函数中(如果可能),但我不知道如何做到这一点。我已经尝试过对此进行一些研究,但我甚至都不知道如何称呼这种定义类的方式。我来自Objective-C,那里的事情似乎更加直截了当。