如何将 MarshalAsAttribute 应用到下面代码的返回类型?
public ISomething Foo()
{
return new MyFoo();
}
最佳答案
根据 http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx :
[return: MarshalAs(<your marshal type>)]
public ISomething Foo()
{
return new MyFoo();
}
关于c# - 如何将 .net 属性应用于返回类型,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/131456/