示例#1
0
        public async Task<IHttpActionResult> SaveUserToken(SetFullNameViewModel model)
        {
            var userId = User.Identity.GetUserId();

            _Uow._LoggedInTracking.Add(new EF.LoggedInTracking
            {
                DateTimeLoggedIn = DateTime.UtcNow,
                Token = model.FullName,
                UserId = userId
            });
            await _Uow.CommitAsync();
            return Ok();
        }
示例#2
0
 public async Task<IHttpActionResult> SetFullName(SetFullNameViewModel model)
 {
     try
     {
         var userId = User.Identity.GetUserId();
         var user = await _Uow._Users.GetAll(x => x.Id == userId).FirstOrDefaultAsync();
         user.FullName = model.FullName;
         _Uow._Users.Update(user);
         await _Uow.CommitAsync();
         return Ok(model.FullName);
     }
     catch (Exception ex)
     {
         return InternalServerError(ex);
     }
 }