コード例 #1
0
        /// <summary>
        /// Get user account by it's ID.
        /// </summary>
        /// <param name="id">The ID of the user account</param>
        /// <returns>User account matching the ID.</returns>
        public User GetUserById(int id)
        {
            using (MediathekEntities context = new MediathekEntities())
            {
                User user = (User)context.Users
                            .Where(u => u.UserId == id)
                            .First();

                context.Detach(user);

                return user;
            }
        }