Esempio n. 1
0
        public Entities.Auto AutoInvoeren(Entities.Auto auto)
        {
            using (IAutoServiceClient agent = new AutoServiceClient())
            {
                agent.BaseUri = new Uri("http://jomaya-autoservice/");
                //agent.BaseUri = new Uri("http://localhost:5003/");
                var result = agent.PostCreateAuto(ObjectMapper.ConvertAuto(auto));

                if (result is AutoService.Models.Auto)
                {
                    return(ObjectMapper.ConvertAuto(result as AutoService.Models.Auto));
                }
                else
                {
                    throw new InvalidOperationException("Een fout is opgetreden bij de MicroService, " + result.ToString());
                }
            }
        }