~ruther/NosSmooth

ref: 040e6825fc3889fdb41ffa1554b74c2cf5857a9f NosSmooth/Local/NosSmooth.LocalClient/Extensions/ServiceCollectionExtensions.cs -rw-r--r-- 657 bytes
040e6825 — František Boháček Initial commit 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.DependencyInjection.Extensions;
using NosSmooth.Core.Client;
using NosSmooth.Core.Extensions;
using NosSmooth.LocalClient.CommandHandlers;

namespace NosSmooth.LocalClient.Extensions;

public static class ServiceCollectionExtensions
{
    public static IServiceCollection AddLocalClient(this IServiceCollection serviceCollection)
    {
        serviceCollection.AddNostaleCore();
        serviceCollection.AddCommandHandler<WalkCommandHandler>();
        
        serviceCollection.TryAddSingleton<INostaleClient, NostaleLocalClient>();

        return serviceCollection;
    }
}
Do not follow this link