Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
I'm trying to get info from the generated umb Data context, but whenever i use a linq expression i get a exception.
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; } }
And the only code i use is
SolexUmbracoDataContext umbContext = new SolexUmbracoDataContext(); StringBuilder builder = new StringBuilder(); builder.Append(umbContext.Products.Count()); return builder.ToString();
Any1 knows why this is happening?
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Getting a System.ArgumentNullException when trying to use linq to Umb
Hello,
I'm trying to get info from the generated umb Data context, but whenever i use a linq expression i get a exception.
The generated code is like this
And the only code i use is
Any1 knows why this is happening?
is working on a reply...