|
@@ -85,13 +85,13 @@ namespace InABox.Clients
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- private static IClient<TEntity> CheckClient<TEntity>() where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ private static IClient<TEntity> CheckClient<TEntity>() where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
return ClientFactory.CreateClient<TEntity>();
|
|
|
}
|
|
|
|
|
|
public static void EnsureColumns<TEntity>(TEntity entity, Columns<TEntity> columns)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
var newColumns = Columns.None<TEntity>()
|
|
|
.AddRange(columns.Where(x => !entity.HasColumn(x.Property)));
|
|
@@ -102,7 +102,7 @@ namespace InABox.Clients
|
|
|
}
|
|
|
}
|
|
|
public static void EnsureColumns<TEntity>(ICollection<TEntity> entities, Columns<TEntity> columns)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
var newColumns = Columns.None<TEntity>()
|
|
|
.AddRange(columns.Where(x => entities.Any(entity => !entity.HasColumn(x.Property))));
|
|
@@ -125,59 +125,59 @@ namespace InABox.Clients
|
|
|
}
|
|
|
|
|
|
public static CoreTable Query<TEntity>(Filter<TEntity>? filter = null, Columns<TEntity>? columns = null, SortOrder<TEntity>? orderby = null, CoreRange? range = null)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
return new Client<TEntity>().Query(filter, columns, orderby, range);
|
|
|
}
|
|
|
|
|
|
public static void Query<TEntity>(Filter<TEntity>? filter, Columns<TEntity>? columns, SortOrder<TEntity>? orderby, CoreRange? range, Action<CoreTable?, Exception?> callback)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Query(filter, columns, orderby, range, callback);
|
|
|
}
|
|
|
|
|
|
public static void Query<TEntity>(Filter<TEntity>? filter, Columns<TEntity>? columns, SortOrder<TEntity>? orderby, Action<CoreTable?, Exception?> callback)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Query(filter, columns, orderby, null, callback);
|
|
|
}
|
|
|
|
|
|
public static void Save<TEntity>(TEntity entity, string auditNote)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Save(entity, auditNote);
|
|
|
}
|
|
|
public static void Save<TEntity>(IEnumerable<TEntity> entities, string auditNote)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
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()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
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()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Save(entities, auditNote, callback);
|
|
|
}
|
|
|
|
|
|
public static void Delete<TEntity>(TEntity entity, string auditNote)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Delete(entity, auditNote);
|
|
|
}
|
|
|
|
|
|
public static void Delete<TEntity>(TEntity entity, string auditNote, Action<TEntity, Exception?> callback)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Delete(entity, auditNote, callback);
|
|
|
}
|
|
|
|
|
|
public static void Delete<TEntity>(IEnumerable<TEntity> entities, string auditNote)
|
|
|
- where TEntity : Entity, IRemotable, IPersistent, new()
|
|
|
+ where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
new Client<TEntity>().Delete(entities, auditNote);
|
|
|
}
|
|
@@ -364,7 +364,7 @@ namespace InABox.Clients
|
|
|
|
|
|
}
|
|
|
|
|
|
- public class Client<TEntity> : Client, IDisposable where TEntity : Entity, IPersistent, IRemotable, new()
|
|
|
+ public class Client<TEntity> : Client, IDisposable where TEntity : Entity, IRemotable, new()
|
|
|
{
|
|
|
private IClient<TEntity> _client;
|
|
|
|