public List <Sensor> GetSensors() { using (var command = _context.CreateCommand()) { command.CommandType = CommandType.StoredProcedure; command.CommandText = @"GetSensors"; command.CommandTimeout = Constants.DbCommandTimeout; return(command.ToList <Sensor>()); } }
public LibraryDTO FilterBooks(BookFilter bookFilter) { try { using (var cmd = _iAdoNetContext.CreateCommand()) { var command = _iBookRepositoryQuery.FilterBooks(bookFilter, cmd); if (command == null) { return(null); } return(command.MapToLibraryDto()); } } catch (Exception ex) { //TODO: Log this the exception information along with the method details to the database for Error tracing //Allowing the exception be rethrown so that LOG4NET can log there is a problem on the api end point return(null); } }