Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7434001
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T09:45:46+00:00 2026-05-29T09:45:46+00:00

I’m trying to get info from the generated umb Data context, but whenever i

  • 0

I’m trying to get info from the generated umb Data context, but whenever i use a linq expression i get a exception when i try to execute the following code:

MyUmbracoDataContext umbContext = new MyUmbracoDataContext();
StringBuilder builder = new StringBuilder();
builder.Append(umbContext.Products.Count());
return builder.ToString();

Exception:

System.ArgumentNullException:
  Value cannot be null.
Parameter name: attribute

  at System.Xml.Linq.XAttribute.op_Explicit(XAttribute attribute)

  at umbraco.Linq.Core.Node.NodeDataProvider.LoadFromXml[T](XElement xml, T node)

  at umbraco.Linq.Core.Node.NodeTree`1.GetEnumerator()

  at System.Linq.Enumerable.Count[TSource](IEnumerable`1 source)

  at XXX.XXX.Controls.Umbraco.usercontrols.ManageDealers.ToCsv(IEnumerable`1dealers)

The generated code is like this

public partial class Product : DocTypeBase, IProduct
    {
        public Product()
        {
        }
        private String _LinkedAccessories;
        /// <summary>
        /// Select the accessories that can be combined with this product
        /// </summary>
        [UmbracoInfo("linkedAccessories", DisplayName = "Linked accessories", Mandatory = false)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual String LinkedAccessories
        {
            get
            {
                return this._LinkedAccessories;
            }
            set
            {
                if ((this._LinkedAccessories != value))
                {
                    this.RaisePropertyChanging();
                    this._LinkedAccessories = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("LinkedAccessories");
                }
            }
        }
        private String _ColumnName;
        /// <summary>
        /// 
        /// </summary>
        [UmbracoInfo("columnName", DisplayName = "Column name", Mandatory = true)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual String ColumnName
        {
            get
            {
                return this._ColumnName;
            }
            set
            {
                if ((this._ColumnName != value))
                {
                    this.RaisePropertyChanging();
                    this._ColumnName = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("ColumnName");
                }
            }
        }
        private Int32? _Image;
        /// <summary>
        /// Image shown in the main slider
        /// </summary>
        [UmbracoInfo("image", DisplayName = "Homepage Slider Image", Mandatory = false)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual Int32? Image
        {
            get
            {
                return this._Image;
            }
            set
            {
                if ((this._Image != value))
                {
                    this.RaisePropertyChanging();
                    this._Image = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("Image");
                }
            }
        }
        private Int32? _OverviewImage;
        /// <summary>
        /// Image shown on the overview page
        /// </summary>
        [UmbracoInfo("overviewImage", DisplayName = "Overview image", Mandatory = false)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual Int32? OverviewImage
        {
            get
            {
                return this._OverviewImage;
            }
            set
            {
                if ((this._OverviewImage != value))
                {
                    this.RaisePropertyChanging();
                    this._OverviewImage = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("OverviewImage");
                }
            }
        }
        private Int32? _ProductDetailImage;
        /// <summary>
        /// Image shown on the product detail pages
        /// </summary>
        [UmbracoInfo("productDetailImage", DisplayName = "Product detail image", Mandatory = false)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual Int32? ProductDetailImage
        {
            get
            {
                return this._ProductDetailImage;
            }
            set
            {
                if ((this._ProductDetailImage != value))
                {
                    this.RaisePropertyChanging();
                    this._ProductDetailImage = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("ProductDetailImage");
                }
            }
        }
        private String _RelatedTo;
        /// <summary>
        /// 
        /// </summary>
        [UmbracoInfo("relatedTo", DisplayName = "Related to", Mandatory = false)]
        [Property()]
        [System.Runtime.Serialization.DataMemberAttribute()]
        public virtual String RelatedTo
        {
            get
            {
                return this._RelatedTo;
            }
            set
            {
                if ((this._RelatedTo != value))
                {
                    this.RaisePropertyChanging();
                    this._RelatedTo = value;
                    this.IsDirty = true;
                    this.RaisePropertyChanged("RelatedTo");
                }
            }
        }
    }

public partial interface IProduct : IDocTypeBase
{
    String LinkedAccessories { get; set; }
    String ColumnName { get; set; }
    Int32? Image { get; set; }
    Int32? OverviewImage { get; set; }
    Int32? ProductDetailImage { get; set; }
    String RelatedTo { get; set; }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T09:45:47+00:00Added an answer on May 29, 2026 at 9:45 am

    It was a problem wich has occured before and the solution was getting the parrent and then to children.
    We think there is some value floating in the database

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to understand how to use SyndicationItem to display feed which is
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I want to construct a data frame in an Rcpp function, but when I
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.