public Srv.Dto.Common.List.GridView.Connection Connection(CallContext context = default) { _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name); var repository = _commonConnectionRepository.GetAllConnection(); var connectionItems = repository.ToList().Select( connection => _mapper.Map <Srv.Dto.Common.Connection>(connection) ).ToList(); var commonAutomationTypeDns = _queryListKeyValue.AutomationTypeId(); var output = new Srv.Dto.Common.List.GridView.Connection(connectionItems, commonAutomationTypeDns.List); return(output); }
public async ValueTask <Srv.Dto.Common.List.GridView.Connection> ConnectionAsync(CallContext context = default) { _logger.LogTrace("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name); try { var repository = await _commonConnectionRepository.GetAllConnectionAsync(); var connectionItems = repository.ToList().Select( connection => _mapper.Map <Srv.Dto.Common.Connection>(connection) ).ToList(); var commonAutomationTypeDns = await _queryListKeyValue.AutomationTypeIdAsync(context); var output = new Srv.Dto.Common.List.GridView.Connection(connectionItems, commonAutomationTypeDns.List); return(output); } catch (Exception ex) { _logger.LogError("Query: " + GetType().FullName + "." + System.Reflection.MethodBase.GetCurrentMethod()?.Name + " - " + ex.Source + " " + ex.Message + " - " + ex.StackTrace); return(await new ValueTask <Dto.Common.List.GridView.Connection>()); } }
public async ValueTask <IActionResult> Index() { ConnectionListGridView = await _connectionQueryListGridView.LoadAllRecordsAsync(); return(View(ConnectionListGridView)); }