#9: use LightweightIocContainer

- add DataHandlingInstaller
pull/26/head
Simon Gockner 6 years ago
parent cbfa772361
commit d091ef7d1e
  1. 4
      GBase/GBase.csproj
  2. 45
      GBase/Installer/DataHandlingInstaller.cs

@ -21,4 +21,8 @@
</None> </None>
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="LightweightIocContainer" Version="2.1.0" />
</ItemGroup>
</Project> </Project>

@ -0,0 +1,45 @@
// Author: Gockner, Simon
// Created: 2020-02-12
// Copyright(c) 2020 SimonG. All Rights Reserved.
using GBase.DataHandling;
using GBase.DataHandling.Cache;
using GBase.Interfaces.DataHandling.Xml;
using GBase.Interfaces.DataHandling.Xml.Cache;
using GBase.Interfaces.DataHandling.Xml.Cache.Factories;
using GBase.Interfaces.DataHandling.Xml.Factories;
using LightweightIocContainer.Interfaces;
using LightweightIocContainer.Interfaces.Installers;
namespace GBase.Installer
{
/// <summary>
/// <see cref="IIocInstaller"/> for the data handling
/// </summary>
public class DataHandlingInstaller : IIocInstaller
{
/// <inheritdoc />
public void Install(IIocContainer container)
{
container.Register<IXmlDataHandler, XmlDataHandler>();
container.Register<IXmlDataReader, XmlDataReader>();
container.Register<IXmlDataWriter, XmlDataWriter>();
//cache
container.Register<IXmlDataHandlerCache, XmlDataHandlerCache>();
container.Register<IXmlDataHandlerCacheEntry, XmlDataHandlerCacheEntry>();
container.Register<IXmlDataHandlerCachePropertyEntry, XmlDataHandlerCachePropertyEntry>();
//factories
container.RegisterFactory<IXmlDataHandlerFactory>();
container.RegisterFactory<IXmlDataReaderFactory>();
container.RegisterFactory<IXmlDataWriterFactory>();
//cache factories
container.RegisterFactory<IXmlDataHandlerCacheFactory>();
container.RegisterFactory<IXmlDataHandlerCacheEntryFactory>();
container.RegisterFactory<IXmlDataHandlerCachePropertyEntryFactory>();
}
}
}
Loading…
Cancel
Save