Files
RobustToolbox/Robust.Shared.Utility/IoC/DependencyCollectionExt.cs
PJB3005 b7a3526131 Move RHI to its own project
Move some of Robust.Shared to a new project so it can be depended upon without adding longer dependency chains.
2025-10-07 18:18:48 +02:00

21 lines
706 B
C#

using JetBrains.Annotations;
namespace Robust.Shared.IoC;
/// <summary>
/// Extension methods for <see cref="IDependencyCollection"/>.
/// </summary>
public static class DependencyCollectionExt
{
/// <summary>
/// Register a type as both implementation and interface.
/// This is equivalent to calling <see cref="IDependencyCollection.Register{TInterface, TImplementation}(bool)"/> with both type args set to <typeparamref name="T"/>.
/// </summary>
/// <param name="deps">The dependency collection to register into.</param>
public static void Register<[MeansImplicitUse] T>(this IDependencyCollection deps)
where T : class
{
deps.Register<T, T>();
}
}