예제 #1
0
        public async Task <bool> ClearRefreshToken(long identityUser)
        {
            var user = await _repo.GetQueryAble <PandaUser>().Where(w => w.Id == identityUser).FirstOrDefaultAsync();

            user.RefreshToken = null;
            _repo.UpdateSpecficProperty(user, u => u.RefreshToken);
            var result = await _repo.SaveAsync();

            return(result.Data);
        }
예제 #2
0
        public static Task <GenericUserContract> GetById(IGenericEFRepository <MsSql1DbContext> _genericEFRepo, int IdentityUser)
        {
            Expression <Func <GenericUser, bool> > predicate = p => p.Id == IdentityUser;
            Expression <Func <GenericUser, GenericUserContract> > selector = s =>
                                                                             new GenericUserContract
            {
                Id           = s.Id,
                Email        = s.Email,
                FirstName    = s.FirstName,
                LastName     = s.LastName,
                OnlineStatus = s.OnlineStatus
            };
            var response = _genericEFRepo.GetQueryAble <GenericUser>()
                           .Where(predicate)
                           .Select(selector)
                           .FirstOrDefaultAsync();

            return(response);
        }
예제 #3
0
 public async Task <double> GetAccountBalance(string pandaAccountId)
 {
     return(await _repo.GetQueryAble <PandaAccount>()
            .Where(w => w.Id == pandaAccountId)
            .Select(s => s.Balances).FirstOrDefaultAsync());
 }