public async Task <IActionResult> GetPropertyTraces() => await Utilities.Utilities.TryCatchAsync( async() => { _logger.LogInformation("Begin HttpGet call GetPropertyTraces"); var response = await _repository.GetPropertyTraces(); if (response != null && response.Any()) { return(Ok(response.JsonSerialize())); } return(NotFound("No results found")); }, HttpErrorHandlerAsync );
/// <summary> /// Consulta la totalidad de las PropertyTraces /// </summary> /// <param name="request">Parametro de entrada que viene vacio pero está preparado para futuras implementaciones</param> /// <param name="context">Contexto del llamado</param> /// <returns>Retorna una colección de PropertyTrace</returns> public override async Task <PropertyTracesResponse> GetPropertyTraces(GetPropertyTracesRequest request, ServerCallContext context) => await Utilities.Utilities.TryCatchAsync( async() => { _logger.LogInformation("Begin grpc call PropertyTraceService.GetPropertyTraces"); var response = await _repository.GetPropertyTraces(); if (response != null && response.Any()) { return(MapToPropertyTracesResponse(response)); } context.Status = new Status(StatusCode.NotFound, "No results found"); return(null); }, async error => { context.Status = new Status(StatusCode.Internal, "An error has occurred, contact the administrator!"); await DbErrorLog(error); return(new PropertyTracesResponse()); } );