public async Task <IHttpActionResult> adjuntoToTextAll() //id del Adjunto { try { log.Info(new MDCSet(this.ControllerContext.RouteData)); Stopwatch tiempo = Stopwatch.StartNew(); var entities = await adjuntoRepo.GetAll(); HashSet <string> tiempos = new HashSet <string>(); if (entities != null && entities.Count() > 0) { var items = exts.Split(';'); HashSet <string> extensiones = new HashSet <string>(items); foreach (var adjunto in entities) { try { log.Info(new MDCSet(this.ControllerContext.RouteData)); Stopwatch tiempo3 = Stopwatch.StartNew(); await adjuntoToText(extensiones, adjunto); var lapso3 = tiempo3.Elapsed.Milliseconds.ToString(); tiempos.Add(adjunto.nombre + ": " + lapso3); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); } } } var tiempo2 = tiempo.Elapsed.Milliseconds.ToString(); tiempos.Add(tiempo2); return(Ok(tiempos)); } catch (Exception e) { log.Error(new MDCSet(this.ControllerContext.RouteData), e); return(InternalServerError(e)); } }