A database based on .net
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

54 lines
1.7 KiB

// 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
{
/// <summary>
/// A client for the GBase
/// </summary>
public class GBaseClient : IGBaseClient //TODO: Add logging?
{
/// <summary>
/// A client for the GBase
/// </summary>
/// <param name="settings">The <see cref="IGBaseClientSettings"/> for this client</param>
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);
}
/// <summary>
/// Functions of the GBase
/// </summary>
public IGBaseService GBase { get; }
/// <summary>
/// Functions of the GBaseTable
/// </summary>
public IGBaseTableService GBaseTable { get; }
/// <summary>
/// Functions of the GBaseEntry
/// </summary>
public IGBaseEntryService GBaseEntry { get; }
/// <summary>
/// Dispose used resources asynchronously
/// </summary>
/// <returns>A <see cref="ValueTask"/> to await</returns>
public async ValueTask DisposeAsync()
{
await GBase.DisposeAsync();
await GBaseTable.DisposeAsync();
await GBaseEntry.DisposeAsync();
}
}
}