コード例 #1
0
        public string GetName(int id)
        {
            DataClasses1DataContext context = new DataClasses1DataContext();
            var data = context.UserProfile.Where(a => a.UserId == id).FirstOrDefault();

            return data.UserName;
        }
コード例 #2
0
        public UserProfile GetData(int id)
        {
            DataClasses1DataContext context = new DataClasses1DataContext();
            var data = context.webpages_UsersInRoles.Where(a => a.UserId == id).FirstOrDefault()
                .UserProfile;

            return data;
        }