如何将 "Dictionary<x,Class>" 作为字典 <x,Interface> 传递?

How to pass "Dictionary<x,Class>" as Dictionary<x,Interface>"?

C# 和 Whosebug 的新手...请随时指出是否应该以不同方式或其他方式提出这个问题。

鉴于:

public interface IPoint {...}
public struct DeliveryPoint : IPoint {...}

以及生成大量投递点字典的代码:

...
Dictionary<uint,DeliveryPoint> dict = new Dictionary<uint,DeliveryPoint>();
...

现在需要将这些点传递给需要接口类型的例程:

public void doSomething( Dictionary<uint,IPoint> dict ) { ...}

以为我可以做类似的事情:

doSomething( dict );

我找到的唯一解决方案是创建一个新列表并复制所有点,这似乎违背了首先实现接口的全部目的。

有没有更好的方法?

使方法对实现接口的类型的值具有通用性。

public void DoSomething<TPoint>(IDictionary<uint, TPoint> dict) where TPoint : IPoint
{
    // do stuff
}