#25: use new methods from IGBaseTable

pull/27/head
Simon G 5 years ago
parent 92c278319e
commit 0a8c1aa549
  1. 20
      GBase/GBaseObject.cs

@ -3,7 +3,9 @@
// Copyright(c) 2020 SimonG. All Rights Reserved. // Copyright(c) 2020 SimonG. All Rights Reserved.
using System; using System;
using System.Linq; using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using GBase.Api; using GBase.Api;
using GBase.Exceptions; using GBase.Exceptions;
using GBase.Interfaces; using GBase.Interfaces;
@ -13,9 +15,9 @@ namespace GBase
/// <summary> /// <summary>
/// GBase object that supplies inheriting classes with methods to get data from a <see cref="IGBase"/> /// GBase object that supplies inheriting classes with methods to get data from a <see cref="IGBase"/>
/// </summary> /// </summary>
public abstract class GBaseObject<T> : IGBaseObject where T : INotifyGBaseEntryChanged public abstract class GBaseObject<T> : IGBaseObject
{ {
private readonly IGBaseTable _gBaseTable; private readonly IGBaseTable<T> _gBaseTable;
/// <summary> /// <summary>
/// GBase object that allows conversion from <see cref="string"/> /// GBase object that allows conversion from <see cref="string"/>
@ -28,12 +30,14 @@ namespace GBase
throw new MissingTableException<T>(); throw new MissingTableException<T>();
} }
protected async Task SetValue<TProperty>(T @this, string propertyName, TProperty value, CancellationToken cancellationToken) =>
await _gBaseTable.SetValue(@this, propertyName, value, cancellationToken);
protected TProperty Get<TProperty>() protected async Task<TProperty> GetValue<TProperty>(T @this, string propertyName, CancellationToken cancellationToken) =>
{ await _gBaseTable.GetValue<TProperty>(@this, propertyName, cancellationToken);
throw new NotImplementedException();
//_gBaseTable.GetEntry<T>() protected async Task<IEnumerable<TProperty>> GetValues<TProperty>(T @this, string propertyName, CancellationToken cancellationToken) =>
} await _gBaseTable.GetValues<TProperty>(@this, propertyName, cancellationToken);
/// <summary> /// <summary>
/// Initialize this <see cref="GBaseObject{T}"/> from a given <see cref="string"/> /// Initialize this <see cref="GBaseObject{T}"/> from a given <see cref="string"/>

Loading…
Cancel
Save