When I add multi ExprotAttribute on a Type, it is working natural. But if I add multi ExprotAttribute to one Property. The MEF just found first ExportAttribute.
I found some code in AttributedComposablePartDefinition.GetExports method as follow, so I think it is by design. But why?
| foreach(MemberInfomemberinmembers) |
| { |
| stringcontractName=member.GetContractNameFromExport(member.GetFirstAttribute<ExportAttribute>()); |
| yieldreturnnewMemberInfoComposableItem(contractName,member); |
| } |
|
| boolinheritAttributes=(flags&BindingFlags.DeclaredOnly)==0; |
|
| foreach(TypetypeWithExportinCompositionServices.GetTypesWithExportAttributes(this._partType,inheritAttributes)) |
| { |
| foreach(ExportAttributeexportAttributeintypeWithExport.GetAttributes<ExportAttribute>(false)) |
| { |
| stringcontractName=typeWithExport.GetContractNameFromExport(exportAttribute); |
| yieldreturnnewMemberInfoComposableItem(contractName,typeWithExport); |
| } |
| } |
|