private MowerService CreateMowerService() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new MowerService(userId); return(service); }
public IHttpActionResult GetAll() { MowerService mowerService = CreateMowerService(); var mowers = mowerService.GetMowers(); return(Ok(mowers)); }
public IHttpActionResult Get(int id) { MowerService mowerService = CreateMowerService(); var mower = mowerService.GetMowerById(id); return(Ok(mower)); }
public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new MowerService(userId); var model = service.GetMowers(); return(View(model)); }