Как применить атрибут .net к типу возврата Как применить атрибут MarshalAsAttribute к типу возвращаемого кода ниже? public ISomething Foo() { return new MyFoo(); } Ответ 1 Согласно http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx: [return: MarshalAs(<your marshal type>)] public ISomething Foo() { return new MyFoo(); } Ответ 2 [return:MarshalAs] public ISomething Foo() { return new MyFoo(); }
Ответ 1 Согласно http://msdn.microsoft.com/en-us/library/system.runtime.interopservices.marshalasattribute.aspx: [return: MarshalAs(<your marshal type>)] public ISomething Foo() { return new MyFoo(); }