Example #1
0
        // GET: Social/Player/{id?}
        public ActionResult Player(int id = 0)
        {
            Player player = null;

            if (id == 0)
            {
                long vkId = InfoManager.GetCurrentUserVkId();
                using (var db = new NiteLigaContext())
                    player = db.Players.FirstOrDefault(x => x.VkId == vkId);
            }
            else
            {
                using (var db = new NiteLigaContext())
                    player = db.Players.FirstOrDefault(x => x.Id == id);
            }

            ViewBag.Player = player;

            return(View());
        }