/// <summary> /// Run ElectionLevel_List, and return results as a list. /// </summary> /// <param name="fldElectionLevelTitle">Value for ElectionLevelTitle</param> /// <param name="connection">The SqlConnection to use</param> /// <param name="transaction">The SqlTransaction to use</param> /// <returns>A collection of __ListItemRow.</returns> public virtual List <ListItemContract> List(string fldElectionLevelTitle , SqlConnection connection, SqlTransaction transaction) { using ( var cmd = new SqlCommand("[Data].[ElectionLevel_List]", connection) { CommandType = CommandType.StoredProcedure, Transaction = transaction }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ElectionLevelTitle", fldElectionLevelTitle) }); using (var r = cmd.ExecuteReader()) return(ListItemLogic.ReadAllNow(r)); } }
/// <summary> /// Run ElectionLevel_List, and return results as a list. /// </summary> /// <param name="fldElectionLevelTitle">Value for ElectionLevelTitle</param> /// <returns>A collection of __ListItemRow.</returns> public virtual List <ListItemContract> List(string fldElectionLevelTitle ) { List <ListItemContract> result = null; VotingInfoDb.ConnectThen(x => { using ( var cmd = new SqlCommand("[Data].[ElectionLevel_List]", x) { CommandType = CommandType.StoredProcedure, CommandTimeout = DefaultCommandTimeout }) { cmd.Parameters.AddRange(new[] { new SqlParameter("@ElectionLevelTitle", fldElectionLevelTitle) }); using (var r = cmd.ExecuteReader()) result = ListItemLogic.ReadAllNow(r); } }); return(result); }