private GunService CreateGunService() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GunService(userId); return(service); }
// GET: Gun public ActionResult Index() { var userId = Guid.Parse(User.Identity.GetUserId()); var service = new GunService(userId); var model = service.GetAttachment(); return(View(model)); }
// POST: api/Gun public void Post([FromBody] Gun value) { var gunService = new GunService(); gunService.Add(value); }
// GET: api/Gun/5 public GunView GetGun(int id) { var gunService = new GunService(); return(gunService.GetGunViews().Where(g => g.Id == id).First()); }
// GET: api/Gun public IEnumerable <GunView> GetGuns() { var gunService = new GunService(); return(gunService.GetGunViews()); }
private GunService NewMethod() { GunService service = CreateGunService(); return(service); }