コード例 #1
0
        public UserFullInfo GetUserProfileViewModel(string userName)
        {
            var result = new UserFullInfo();
            var model  = _dataBase.Users.FirstOrDefault(t => t.Username == userName);

            if (model != null)
            {
                result.ID        = model.ID;
                result.Username  = model.Username;
                result.IsDeleted = model.IsDeleted;
                result.Rolename  = model.Role.Rolename;

                var userData = _dataBase.UserDatas.FirstOrDefault(t => t.User_ID == model.ID);
                if (userData != null)
                {
                    result.FirstName    = userData.FirstName;
                    result.LastName     = userData.LastName;
                    result.Phone        = userData.Phone;
                    result.PhotoLink    = userData.PhotoLink;
                    result.LocationName = userData.Location.LocationName;
                }
                return(result);
            }
            return(null);
        }
コード例 #2
0
        public UserFullInfo GetUserProfileViewModel(string userName)
        {
            var result = new UserFullInfo();
            var model =  _dataBase.Users.FirstOrDefault(t => t.Username == userName);
            if (model != null)
            {
                result.ID = model.ID;
                result.Username = model.Username;
                result.IsDeleted = model.IsDeleted;
                result.Rolename = model.Role.Rolename;

                var userData = _dataBase.UserDatas.FirstOrDefault(t => t.User_ID == model.ID);
                if (userData != null)
                {
                    result.FirstName = userData.FirstName;
                    result.LastName = userData.LastName;
                    result.Phone = userData.Phone;
                    result.PhotoLink = userData.PhotoLink;
                    result.LocationName = userData.Location.LocationName;
                }
                return result;
            }
            return null;
        }