Can't get the current LoginTime and LogOutTime for IdentityServer

  • Thread starter Thread starter eng teong
  • Start date Start date
E

eng teong

Guest
Hi All,

When I implement my code with the Interface for Identity Server to get the <g class="gr_ gr_94 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="94" id="94">loginTime</g> and <g class="gr_ gr_103 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="103" id="103">logOutTime</g> and it can't get the current <g class="gr_ gr_225 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="225" id="225">loginTime</g> and <g class="gr_ gr_238 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="238" id="238">logOutTime</g>

1383270.png

here is my code:
UserInfoService

public async Task UpdateLoginTimeAsync(string userId)
{
var user = _dbIdentity.Users.Where(x => x.Id == userId).FirstOrDefault();
user.LoginTime = DateTime.Now;
_dbIdentity.Users.Update(user);
await _dbIdentity.SaveChangesAsync();
}

public async Task UpdateLogOutTimeAsync(string userId)
{
var user = _dbIdentity.Users.Where(x => x.Id == userId).FirstOrDefault();
user.LogoutTime = DateTime.Now;
_dbIdentity.Users.Update(user);
await _dbIdentity.SaveChangesAsync();
}

Task<UserInfo> IUserInfoService.UpdateLoginTimeAsync(string userId)
{
throw new NotImplementedException();
}

public Task<UserInfo> UpdateLogoutTimeAsync(string userId)
{
throw new NotImplementedException();
}


and IUserServiceInfo.cs

Task<UserInfo> UpdateLoginTimeAsync(string userId);

Task<UserInfo> UpdateLogoutTimeAsync(string userId);
How to get the current <g class="gr_ gr_317 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="317" id="317">LoginTime</g> and <g class="gr_ gr_324 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="324" id="324">logoutTime</g>?

Thank for the help.



I am newbie in enterprise as developer.

Continue reading...
 
Back
Top