Exemplo n.º 1
0
 public IActionResult GetDriver([FromQuery] SortDriver sort = SortDriver.Default)
 {
     return(Ok(
                _driverRepository
                .Get()
                .OrderBy(driver => {
         if (sort == SortDriver.LastName)
         {
             return driver.Name.LastName;
         }
         else
         {
             return driver.Name.FirstName;
         }
     }).ToList()
                ));
 }
Exemplo n.º 2
0
        private static async Task <int> RunSortAndReturnExitCode(Options options)
        {
            try
            {
                var driver = SortDriver.Create(
                    options.SourceFilePath,
                    options.RunSizeHintInMiB,
                    options.MaxDegreeOfParallelism,
                    mergeBufferSizePerRun: 1024 * 1024,
                    Log);

                await driver.Sort();
            }
            catch (Exception ex)
            {
                WriteErrorMessage(ex);
                return(ExitCodes.RuntimeError);
            }
            return(0);
        }