Click here to Skip to main content
15,888,157 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
i read on some sites bout mef framework and not understand any thing

can you tell me why using export and import attributes and what is befit ?

please show me any simple example ?


What I have tried:

using System.ComponentModel.Composition;
using MefShared.Interfaces;

namespace MefAuthentication
{
    [Export(typeof(IAuthentication))]
    [ExportMetadata("AuthenticationType", "3")]
    public class ThirdAuthentication : IAuthentication
    {
        public string Authenticate(string username, string password)
        {
            return "Authentication Implementation 3 is invoked";
        }
    }
}
Here is export why use export here 

I already use inheritance 

so why use Export 
Posted
Updated 17-Dec-19 3:17am

1 solution

The first google result for me is Managed Extensibility Framework (MEF) | Microsoft Docs[^] and has a section that explains those attributes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900