|
|
|
|
@ -104,9 +104,9 @@ namespace GBase |
|
|
|
|
List<object> parameters = new List<object>(); |
|
|
|
|
foreach (var column in Columns) |
|
|
|
|
{ |
|
|
|
|
IDataHandler dataHandler = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
using IPoolItem<IDataHandler> dataHandlerItem = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
|
|
|
|
|
parameters.Add(await GenericMethodCaller.CallAsync(dataHandler, |
|
|
|
|
parameters.Add(await GenericMethodCaller.CallAsync(dataHandlerItem.Use(), |
|
|
|
|
nameof(IDataHandler.GetValue), |
|
|
|
|
BindingFlags.Public | BindingFlags.Instance, |
|
|
|
|
typeof(T), column.Type, |
|
|
|
|
@ -161,8 +161,8 @@ namespace GBase |
|
|
|
|
Entries.Add(entry); |
|
|
|
|
|
|
|
|
|
using IGBaseFile file = _fileHandler.CreateEntryFile(entry, this); |
|
|
|
|
IDataHandler dataHandler = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
await dataHandler.AddEntry(entry, this, file.File, cancellationToken); |
|
|
|
|
using IPoolItem<IDataHandler> dataHandlerItem = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
await dataHandlerItem.Use().AddEntry(entry, this, file.File, cancellationToken); |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
@ -185,22 +185,22 @@ namespace GBase |
|
|
|
|
public async Task SetValue<TProperty>(T entry, string propertyName, TProperty value, CancellationToken cancellationToken) |
|
|
|
|
{ |
|
|
|
|
using IGBaseFile file = await _fileHandler.RequestEntryFile(entry); |
|
|
|
|
IDataHandler dataHandler = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
await dataHandler.SetValue<T, TProperty>(file.File, propertyName, value, cancellationToken); |
|
|
|
|
using IPoolItem<IDataHandler> dataHandlerItem = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
await dataHandlerItem.Use().SetValue<T, TProperty>(file.File, propertyName, value, cancellationToken); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<TProperty> GetValue<TProperty>(T entry, string propertyName, CancellationToken cancellationToken) |
|
|
|
|
{ |
|
|
|
|
using IGBaseFile file = await _fileHandler.RequestEntryFile(entry); |
|
|
|
|
IDataHandler dataHandler = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
return await dataHandler.GetValue<T, TProperty>(file.File, propertyName, cancellationToken); |
|
|
|
|
using IPoolItem<IDataHandler> dataHandlerItem = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
return await dataHandlerItem.Use().GetValue<T, TProperty>(file.File, propertyName, cancellationToken); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public async Task<IEnumerable<TProperty>> GetValues<TProperty>(T entry, string propertyName, CancellationToken cancellationToken) |
|
|
|
|
{ |
|
|
|
|
using IGBaseFile file = await _fileHandler.RequestEntryFile(entry); |
|
|
|
|
IDataHandler dataHandler = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
return await dataHandler.GetValues<T, TProperty>(file.File, propertyName, cancellationToken); |
|
|
|
|
using IPoolItem<IDataHandler> dataHandlerItem = await _dataHandlerPool.RequestDataHandler(this, false, cancellationToken); |
|
|
|
|
return await dataHandlerItem.Use().GetValues<T, TProperty>(file.File, propertyName, cancellationToken); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
|
|