|
@@ -74,47 +74,47 @@ namespace InABox.Clients
|
|
|
public static CoreTable Query<TEntity>(Filter<TEntity>? filter = null, Columns<TEntity>? columns = null, SortOrder<TEntity>? orderby = null)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- return CheckClient<TEntity>().Query(filter, columns, orderby);
|
|
|
+ return new Client<TEntity>().Query(filter, columns, orderby);
|
|
|
}
|
|
|
|
|
|
public static void Query<TEntity>(Filter<TEntity>? filter, Columns<TEntity>? columns, SortOrder<TEntity>? orderby, Action<CoreTable?, Exception?> callback)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Query(filter, columns, orderby, callback);
|
|
|
+ new Client<TEntity>().Query(filter, columns, orderby, callback);
|
|
|
}
|
|
|
|
|
|
public static void Save<TEntity>(TEntity entity, string auditNote)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Save(entity, auditNote);
|
|
|
+ new Client<TEntity>().Save(entity, auditNote);
|
|
|
}
|
|
|
public static void Save<TEntity>(IEnumerable<TEntity> entities, string auditNote)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Save(entities, auditNote);
|
|
|
+ new Client<TEntity>().Save(entities, auditNote);
|
|
|
}
|
|
|
|
|
|
public static void Save<TEntity>(TEntity entity, string auditNote, Action<TEntity, Exception?> callback)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Save(entity, auditNote, callback);
|
|
|
+ new Client<TEntity>().Save(entity, auditNote, callback);
|
|
|
}
|
|
|
public static void Save<TEntity>(IEnumerable<TEntity> entities, string auditNote, Action<IEnumerable<TEntity>, Exception?> callback)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Save(entities, auditNote, callback);
|
|
|
+ new Client<TEntity>().Save(entities, auditNote, callback);
|
|
|
}
|
|
|
|
|
|
public static void Delete<TEntity>(TEntity entity, string auditNote)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Delete(entity, auditNote);
|
|
|
+ new Client<TEntity>().Delete(entity, auditNote);
|
|
|
}
|
|
|
|
|
|
public static void Delete<TEntity>(IEnumerable<TEntity> entities, string auditNote)
|
|
|
where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
{
|
|
|
- CheckClient<TEntity>().Delete(entities, auditNote);
|
|
|
+ new Client<TEntity>().Delete(entities, auditNote);
|
|
|
}
|
|
|
|
|
|
public static void QueryMultiple(
|
|
@@ -334,13 +334,11 @@ namespace InABox.Clients
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- using (var timer = new Profiler<TEntity>(false))
|
|
|
- {
|
|
|
- CheckSupported();
|
|
|
- var result = _client.Query(filter, columns, orderby);
|
|
|
- timer.Log(result.Rows.Count);
|
|
|
- return result;
|
|
|
- }
|
|
|
+ using var timer = new Profiler<TEntity>(false);
|
|
|
+ CheckSupported();
|
|
|
+ var result = _client.Query(filter, columns, orderby);
|
|
|
+ timer.Log(result.Rows.Count);
|
|
|
+ return result;
|
|
|
}
|
|
|
catch(RequestException e)
|
|
|
{
|
|
@@ -361,7 +359,7 @@ namespace InABox.Clients
|
|
|
CheckSupported();
|
|
|
_client.Query(filter, columns, sort, (c, e) =>
|
|
|
{
|
|
|
- timer.Dispose(c != null ? c.Rows.Count : -1);
|
|
|
+ timer.Log(c != null ? c.Rows.Count : -1);
|
|
|
callback?.Invoke(c, e);
|
|
|
});
|
|
|
}
|