public static Task <IEnumerable <DbCommandResult> > ExecuteAsync(this RoscoeDb db, CancellationToken token = default, params IWrapper <IRoscoeCommand>[] commands) { Check.IsNotNull(db, nameof(db)); Check.IsNotNull(commands, nameof(commands)); return(db.ExecuteAsync(token, commands.Select(x => x.Value).ToArray())); }
public static async Task <T> ExecuteAsync <T>(this RoscoeDb db, RoscoeCommand <T> command, CancellationToken token = default) { Check.IsNotNull(db, nameof(db)); Check.IsNotNull(command, nameof(command)); var result = await db.ExecuteAsync(token, new[] { command }); return(command.Convert(result.First())); }
this RoscoeDb db, IWrapper <RoscoeCommand <T1> > command1, IWrapper <RoscoeCommand <T2> > command2, CancellationToken token = default) =>
public static Task <T> ExecuteAsync <T>(this RoscoeDb db, IWrapper <RoscoeCommand <T> > command, CancellationToken token = default) => db.ExecuteAsync(command.Value, token);