Exemplo n.º 1
0
        private MowerService CreateMowerService()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new MowerService(userId);

            return(service);
        }
Exemplo n.º 2
0
        public IHttpActionResult GetAll()
        {
            MowerService mowerService = CreateMowerService();
            var          mowers       = mowerService.GetMowers();

            return(Ok(mowers));
        }
Exemplo n.º 3
0
        public IHttpActionResult Get(int id)
        {
            MowerService mowerService = CreateMowerService();
            var          mower        = mowerService.GetMowerById(id);

            return(Ok(mower));
        }
Exemplo n.º 4
0
        public ActionResult Index()
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new MowerService(userId);
            var model   = service.GetMowers();

            return(View(model));
        }