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));
        }
Example #3
0
        // POST: api/Gun
        public void Post([FromBody] Gun value)
        {
            var gunService = new GunService();

            gunService.Add(value);
        }
Example #4
0
        // GET: api/Gun/5
        public GunView GetGun(int id)
        {
            var gunService = new GunService();

            return(gunService.GetGunViews().Where(g => g.Id == id).First());
        }
Example #5
0
        // GET: api/Gun
        public IEnumerable <GunView> GetGuns()
        {
            var gunService = new GunService();

            return(gunService.GetGunViews());
        }
        private GunService NewMethod()
        {
            GunService service = CreateGunService();

            return(service);
        }