public ActionResult <CountryViewModel> Get(Guid id) { var res = _bo.Read(id); if (res.Success) { if (res.Result == null) { return(NotFound()); } var vm = CountryViewModel.Parse(res.Result); return(vm); } else { return(new ObjectResult(HttpStatusCode.InternalServerError)); } }
public void TestCreateCountry() { BoraNowSeeder.Seed(); var vbo = new CountryBusinessObject(); var country = new Country("madagascar"); var resCreate = vbo.Create(country); var restGet = vbo.Read(country.Id); Assert.IsTrue(resCreate.Success && restGet.Success && restGet.Result != null); }