internal void Delete <T>(T target) { using (SqlConnection connection = new SqlConnection(connectionString)) { string targetSProc = SProcFactory.RetrieveDeleteSProcName <T>(); object parameters = ConvertToDataTable(target); connection.Execute(targetSProc, parameters, commandType: System.Data.CommandType.StoredProcedure); } }
internal List <U> Retrieve <T, U>(T target) { List <U> result; using (SqlConnection connection = new SqlConnection(connectionString)) { string targetSProc = SProcFactory.RetrieveRetrievalSProcName <T>(); object parameters = ConvertToDataTable(target); result = connection.Query <U>(targetSProc, parameters, commandType: System.Data.CommandType.StoredProcedure).ToList(); } return(result); }