The best "workaround" is to create and use a normal, "named" type that implements the interface.
But if you insist that an anonymous type be used, consider using a dynamic interface proxy framework like ImpromptuInterface
.
?var myInterface = new { x = 44, y = 55 }.ActLike<ICoOrd>();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…