public ActionResult <InterestPointViewModel> Get(Guid id)
        {
            var res = _bo.Read(id);

            if (res.Success)
            {
                if (res.Result == null)
                {
                    return(NotFound());
                }
                var cvm = InterestPointViewModel.Parse(res.Result);
                return(cvm);
            }
            else
            {
                return(new ObjectResult(HttpStatusCode.InternalServerError));
            }
        }
Esempio n. 2
0
        public void TestCreateInterestPoint()
        {
            BoraNowSeeder.Seed();
            var ipbo = new InterestPointBusinessObject();
            var cbo  = new CompanyBusinessObject();
            var pbo  = new ProfileBusinessObject();

            var profile = new Profile("II", "AA");

            pbo.Create(profile);

            var company = new Company("kfc", "you", "9111222", "11111", profile.Id);

            cbo.Create(company);

            var interestPoint = new InterestPoint("a", "b", "c", "d", "e", "f", "g", true, true, company.Id);

            var resCreate = ipbo.Create(interestPoint);
            var resGet    = ipbo.Read(interestPoint.Id);

            Assert.IsTrue(resCreate.Success && resGet.Success && resGet.Result != null);
        }