public async Task <ActionResult <ServiceType> > Get(Guid id) { try { return(Ok(await ServiceTypeManager.LoadById(id))); } catch (Exception ex) { return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message)); } }
public void LoadByIdTest() { var task = ServiceTypeManager.Load(); List <ServiceType> serviceTypes = task.Result; task.Wait(); Guid id = serviceTypes.FirstOrDefault().Id; var task2 = ServiceTypeManager.LoadById(id); ServiceType serviceType = task2.Result; task2.Wait(); Assert.IsTrue(serviceType.Id == id); }