本文介绍了如何将 属性应用于返回类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将 MarshalAsAttribute 应用于下面代码的返回类型?
How do I apply the MarshalAsAttribute to the return type of the code below?
public ISomething Foo() { return new MyFoo(); } 推荐答案根据msdn.microsoft/en-us/library/system.runtime.interopservices.marshalasattribute.aspx:
[return: MarshalAs(<your marshal type>)] public ISomething Foo() { return new MyFoo(); }更多推荐
如何将 .net 属性应用于返回类型
发布评论