Example #1
0
        //Read/Get all zoos method
        public IHttpActionResult Get()
        {
            ZooServices zooService = CreateZooService();
            var         zoos       = zooService.GetZoos();

            return(Ok(zoos));
        }
Example #2
0
        //Read/Get zoo by ID
        public IHttpActionResult GetById(int id)
        {
            ZooServices zooService = CreateZooService();
            var         zoo        = zooService.GetZooById(id);

            return(Ok(zoo));
        }
Example #3
0
        private ZooServices CreateZooService()
        {
            var userId     = Guid.Parse(User.Identity.GetUserId());
            var zooService = new ZooServices(userId);

            return(zooService);
        }