15 lines
445 B
C#
15 lines
445 B
C#
namespace DanieleMarotta.RiversongCodeShowcase
|
|
{
|
|
public static class ServiceLocatorExtensions
|
|
{
|
|
public static void RegisterService<T>(this IServiceLocator serviceLocator, T service)
|
|
{
|
|
serviceLocator.RegisterService(typeof(T), service);
|
|
}
|
|
|
|
public static T GetService<T>(this IServiceLocator serviceLocator)
|
|
{
|
|
return (T)serviceLocator.GetService(typeof(T));
|
|
}
|
|
}
|
|
} |