Пример #1
0
        /// <summary>
        /// Gets a model for the member with the specified identifier.
        /// </summary>
        /// <typeparam name="T">The member model type.</typeparam>
        /// <param name="id">The member identifier.</param>
        /// <returns>A model for the member with the specified identifier.</returns>
        /// <exception cref="ArgumentException">Thrown if <typeparamref name="T" /> is not a member model type.</exception>
        public T GetMember <T>(int id)
            where T : class, new()
        {
            if (!typeof(T).IsModelType <MemberTypeAttribute>())
            {
                throw new ArgumentException($"Type {typeof(T)} is not a member model type.");
            }

            return(GetMember <T>(_umbracoHelperWrapper.TypedMember(id)));
        }