コード例 #1
0
 public RefreshtokenViewModel GetByRefreshToken(string refreshToken)
 {
     return(m_RefreshtokenService.FindBy(x => x.HASH == refreshToken).Select(item => new RefreshtokenViewModel
     {
         Id = item.ID,
         Dtemissao = item.DTEMISSAO,
         Hash = item.HASH,
         Protectedticket = item.PROTECTEDTICKET,
         Userid = item.USERID,
         User = m_AspNetUsersService.FindBy(x => x.Id == item.USERID).Select(user => new AspNetUsersViewModel {
             Id = user.Id,
             Email = user.Email,
             Accessfailedcount = user.AccessFailedCount,
             Username = user.UserName,
             Lockoutenabled = user.LockoutEnabled,
             Lockoutenddateutc = user.LockoutEndDateUtc,
         }).FirstOrDefault(),
     }).FirstOrDefault());
 }
コード例 #2
0
        public ClienteViewModel1 GetByRefreshToken(string refresh_token)
        {
            var refreshToken = m_RefreshtokenServices.FindBy(x => x.HASH == refresh_token);

            if (refresh_token == null)
            {
                return(null);
            }

            var userid = refreshToken.FirstOrDefault().USERID;

            return(m_ClienteService.FindBy(x => x.USERID == userid).Select(item => new ClienteViewModel1
            {
                Id = item.ID,
                Nome = item.NOME,
                Qtdacesso = item.QTDACESSO ?? 0,
                Receberfeeds = item.RECEBERFEEDS ?? 0
            }).FirstOrDefault());
        }