コード例 #1
0
        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;
        }
コード例 #2
0
        public void SetCurrentUser(UserModel user)
        {
            var curr = _userRepository
                        .Query
                        .Where(u => u.PartitionKey == "ana" && u.RowKey == user.id)
                        .FirstOrDefault();

            base.SetCurrentUser(curr);
        }
コード例 #3
0
        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);
        }