Ejemplo n.º 1
0
 /// <summary>
 /// 异步执行一个获取递增列值的命令模型。
 /// </summary>
 /// <typeparam name="TEntity">实体的数据类型。</typeparam>
 /// <param name="bus">命令总线。</param>
 /// <param name="tunnel">用于个性化表名和命令的暗道,可以为 null 值。</param>
 /// <returns>递增列值。</returns>
 public static Task <long> GetIdentityAsync <TEntity>(this ICommandBus bus, ICommandTunnel tunnel = null)
 => bus.CallAsync(new CMD.GetIdentity <TEntity>()
 {
     Tunnel = tunnel
 });
Ejemplo n.º 2
0
 /// <summary>
 /// 异步执行一个添加的命令模型。
 /// </summary>
 /// <typeparam name="TEntity">实体的数据类型。</typeparam>
 /// <param name="bus">命令总线。</param>
 /// <param name="entity">实体的实例。</param>
 /// <param name="tunnel">用于个性化表名和命令的暗道,可以为 null 值。</param>
 /// <returns>受影响的行。</returns>
 public static Task <int> AddAnonymousAsync <TEntity>(this ICommandBus bus, object entity, ICommandTunnel tunnel = null)
 => bus.CallAsync(new CMD.Add <TEntity>()
 {
     Entity = entity, Tunnel = tunnel
 });