public UserModel GetUser(string id) { UserModel ret = null; try { var user = _userRepository .Query .Where(u => u.PartitionKey == "ana" && u.RowKey == id) .FirstOrDefault(); ret = new UserModel() { id = user.RowKey, email = user.Email, name = user.UserName, identity_provider = user.IdentityProvider }; } catch (Exception) { } return ret; }
public void SetCurrentUser(UserModel user) { var curr = _userRepository .Query .Where(u => u.PartitionKey == "ana" && u.RowKey == user.id) .FirstOrDefault(); base.SetCurrentUser(curr); }
public void UpdateMyUserProfile(UserModel user) { var userToUpdate = _userRepository.Query .Where(u => u.PartitionKey == "ana" && u.RowKey == user.id).FirstOrDefault(); userToUpdate.DisplayName = user.name; userToUpdate.Email = user.email; _userRepository.AddOrUpdateEntity(userToUpdate); }