// Author: Gockner, Simon
// Created: 2020-02-10
// Copyright(c) 2020 SimonG. All Rights Reserved.
using System.Threading.Tasks;
using GBase.Api.Services;
using GBase.Client.Interfaces;
using GBase.Client.Services;
namespace GBase.Client
{
///
/// A client for the GBase
///
public class GBaseClient : IGBaseClient //TODO: Add logging?
{
///
/// A client for the GBase
///
/// The for this client
public GBaseClient(IGBaseClientSettings settings)
{
GBase = new GBaseService(settings.Protocol, settings.ServerProtocolGBaseEndpointAddress);
GBaseTable = new GBaseTableService(settings.Protocol, settings.ServerProtocolGBaseTableEndpointAddress);
GBaseEntry = new GBaseEntryService(settings.Protocol, settings.ServerProtocolGBaseEntryEndpointAddress);
}
///
/// Functions of the GBase
///
public IGBaseService GBase { get; }
///
/// Functions of the GBaseTable
///
public IGBaseTableService GBaseTable { get; }
///
/// Functions of the GBaseEntry
///
public IGBaseEntryService GBaseEntry { get; }
///
/// Dispose used resources asynchronously
///
/// A to await
public async ValueTask DisposeAsync()
{
await GBase.DisposeAsync();
await GBaseTable.DisposeAsync();
await GBaseEntry.DisposeAsync();
}
}
}