Esempio n. 1
0
 public async Task <ActionResult <ServiceType> > Get(Guid id)
 {
     try
     {
         return(Ok(await ServiceTypeManager.LoadById(id)));
     }
     catch (Exception ex)
     {
         return(StatusCode(StatusCodes.Status500InternalServerError, ex.Message));
     }
 }
Esempio n. 2
0
        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);
        }