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); }
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); }
public async Task <double> GetAccountBalance(string pandaAccountId) { return(await _repo.GetQueryAble <PandaAccount>() .Where(w => w.Id == pandaAccountId) .Select(s => s.Balances).FirstOrDefaultAsync()); }