public List <PersonnaTL> List() { using (DbInterogator interogator = new DbInterogator(_configuration)) { interogator.SetStoredProcedureWithParams(LIST_PROC_NAME, null); using (var sqlReader = interogator.Execute()) { List <PersonnaTL> list = new List <PersonnaTL>(); while (sqlReader.Read()) { list.Add(ToObject(sqlReader)); } return(list); } } }
public PersonnaTL Get(int id) { using (DbInterogator interogator = new DbInterogator(_configuration)) { interogator.SetStoredProcedureWithParams(LIST_PROC_NAME, new Dictionary <string, object> { { "id", id } }); using (var sqlReader = interogator.Execute()) { PersonnaTL item = new PersonnaTL(); if (sqlReader.Read()) { item = ToObject(sqlReader); } return(item); } } }