public static object ExecuteScalar(this ObjectContext db, TemplateQuery query) { using (var r = DbReader.CreateCommand(db, query)) { return(r.Command.ExecuteScalar()); } }
public static int ExecuteNonQuery(this DbContext db, TemplateQuery query) { using (var r = DbReader.CreateCommand(db, query)) { return(r.Command.ExecuteNonQuery()); } }