- add type to IGBaseTable

pull/26/head
Simon Gockner 6 years ago
parent 62b86b9557
commit 4249a9aa9d
  1. 11
      GBase/GBaseTable.cs
  2. 8
      GBase/Interfaces/IGBaseTable.cs

@ -23,6 +23,11 @@ namespace GBase
Entries = new List<IGBaseEntry>(); Entries = new List<IGBaseEntry>();
} }
/// <summary>
/// The <see cref="System.Type"/> of the class that this <see cref="IGBaseTable"/> represents
/// </summary>
public Type Type { get; private set; }
/// <summary> /// <summary>
/// The name of this <see cref="IGBaseTable"/> /// The name of this <see cref="IGBaseTable"/>
/// </summary> /// </summary>
@ -37,11 +42,13 @@ namespace GBase
/// <summary> /// <summary>
/// Initialize this <see cref="IGBase"/> /// Initialize this <see cref="IGBase"/>
/// </summary> /// </summary>
/// <param name="type">The <see cref="System.Type"/> of the class that this <see cref="IGBaseTable"/> represents</param>
/// <param name="name">The name of this <see cref="IGBaseTable"/></param> /// <param name="name">The name of this <see cref="IGBaseTable"/></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the asynchronous operation</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the asynchronous operation</param>
/// <returns>True if successful, false if not</returns> /// <returns>True if successful, false if not</returns>
public async Task<bool> Init(string name, CancellationToken cancellationToken) public async Task<bool> Init(Type type, string name, CancellationToken cancellationToken)
{ {
Type = type;
Name = name; Name = name;
//TODO: Init Entries list depending on GBaseEntryAttributes set for this GBaseTable //TODO: Init Entries list depending on GBaseEntryAttributes set for this GBaseTable
@ -55,7 +62,7 @@ namespace GBase
/// <returns>A <see cref="ValueTask"/> to await</returns> /// <returns>A <see cref="ValueTask"/> to await</returns>
public async ValueTask DisposeAsync() public async ValueTask DisposeAsync()
{ {
throw new System.NotImplementedException(); throw new NotImplementedException();
} }
} }
} }

@ -14,6 +14,11 @@ namespace GBase.Interfaces
/// </summary> /// </summary>
public interface IGBaseTable : IAsyncDisposable public interface IGBaseTable : IAsyncDisposable
{ {
/// <summary>
/// The <see cref="System.Type"/> of the class that this <see cref="IGBaseTable"/> represents
/// </summary>
Type Type { get; }
/// <summary> /// <summary>
/// The name of this <see cref="IGBaseTable"/> /// The name of this <see cref="IGBaseTable"/>
/// </summary> /// </summary>
@ -27,9 +32,10 @@ namespace GBase.Interfaces
/// <summary> /// <summary>
/// Initialize this <see cref="IGBase"/> /// Initialize this <see cref="IGBase"/>
/// </summary> /// </summary>
/// <param name="type">The <see cref="System.Type"/> of the class that this <see cref="IGBaseTable"/> represents</param>
/// <param name="name">The name of this <see cref="IGBaseTable"/></param> /// <param name="name">The name of this <see cref="IGBaseTable"/></param>
/// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the asynchronous operation</param> /// <param name="cancellationToken">A <see cref="CancellationToken"/> to cancel the asynchronous operation</param>
/// <returns>True if successful, false if not</returns> /// <returns>True if successful, false if not</returns>
Task<bool> Init(string name, CancellationToken cancellationToken); Task<bool> Init(Type type, string name, CancellationToken cancellationToken);
} }
} }
Loading…
Cancel
Save