public bool Login([FromServices] IPokerService PokerService, string UserId) { try { HttpContext.Session.SetString("UserId", UserId); var poker = PokerService.GetMyAll(UserId); if (poker.Count() == 0) { PokerService.AddMyPoker("3", UserId); } return(true); } catch { return(false); } }
public IEnumerable <myPoker> GetMyAll([FromServices] IPokerService PokerService) { var userId = HttpContext.Session.GetString("UserId"); return(PokerService.GetMyAll(userId)); }