Importing (Basic)

Download .net eBook


using System;
using System.ComponentModel.Composition;

namespace Demo
    public sealed class UserWriter
        private IUserProvider userProvider;

        public void PrintAllUsers()
            foreach (User user in this.userProvider.GetAllUsers())

This is a type that has a dependency on an IUserProvider, which could be defined anywhere. Like the previous example, all that matters is that the application knows where to look for the matching export (via the ComposablePartCatalogs it creates).


Contributors: 1
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial:

Download eBook