public IActionResult GetAllWorkOrder()
        {
            Stopwatch stopwatch = new Stopwatch();

            stopwatch.Start();
            var worksOrders = _workOrderRepository.GetAll();

            stopwatch.Stop();
            var time = stopwatch.ElapsedMilliseconds;

            var pageNumber             = 1;
            int numberOfObjectsPerPage = 10;
            var queryResultPage        = worksOrders
                                         .Skip(numberOfObjectsPerPage * (pageNumber - 1))
                                         .Take(numberOfObjectsPerPage);

            return(Ok(new
            {
                TempoConsultaEPopulacaoObjeto = $"{time} ms",
                totalItensRetornado = worksOrders.Count(),
                DezPrimeirosItens = queryResultPage,
            }));
        }
Ejemplo n.º 2
0
 public List <tblInwardWO> GetAll()
 {
     return(_workOrderRepository.GetAll());
 }