public static async Task <object> ExecuteScalarAsync(this ObjectContext db, TemplateQuery query) { using (var r = await DbReader.CreateCommandAsync(db, query)) { return(await r.Command.ExecuteScalarAsync()); } }
public static async Task <int> ExecuteNonQueryAsync(this DbContext db, TemplateQuery query) { using (var r = await DbReader.CreateCommandAsync(db, query)) { return(await r.Command.ExecuteNonQueryAsync()); } }