vincentbitter / dependency-sorter

Load your modules or plugins the right order by sorting them with Dependency Sorter

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build status codecov NuGet NuGet

DependencySorter

Load your modules or plugins the right order by sorting them with Dependency Sorter.

How to use

DependencySorter is build as a generic IEnumerable, allowing you to sort any kind of object/type.

Example with strings:

var collection = new DependencyCollection<string>();
collection.Add("test2", "test");
collection.Add("test");

var list = collection.ToList(); // returns ["test", "test2"]

Example with types:

var collection = new DependencyCollection<Type>();
collection.Add(typeof(UserService), typeof(ConfigurationService));
collection.Add(typeof(ConfigurationService));

var list = collection.ToList(); // returns [ConfigurationService, UserService]

About

Load your modules or plugins the right order by sorting them with Dependency Sorter

License:MIT License


Languages

Language:C# 100.0%