Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Feb 25, 2013 01:26 PM by Mstkk
Member
9 Points
42 Posts
Feb 24, 2013 09:40 PM|LINK
That lines work good But
List<ProductPicture> piclist = new List<ProductPicture>(); piclist.AddRange((List<ProductPicture>)pPictureRepository.GetProductPhotos(p.ID.ToString()));
That Lines Doesnt Work !
p.Picture.AddRange((List<ProductPicture>)pPictureRepository.GetProductPhotos(p.ID.ToString()));
This Line Doesnt Work They are same codes ! just different p.picture on my Product class like this
public virtual List<ProductPicture> Picture { get; set; }
All-Star
27454 Points
4542 Posts
Feb 24, 2013 10:35 PM|LINK
What datatype is being returned from your GetProductPhotos() method from your Picture Repository?
Have you tried just using a .ToList() following that method?
piclist.AddRange(pPictureRepository.GetProductPhotos(p.ID.ToString()).ToList());
Feb 25, 2013 01:26 PM|LINK
Rion Williams What datatype is being returned from your GetProductPhotos() method from your Picture Repository? Have you tried just using a .ToList() following that method? piclist.AddRange(pPictureRepository.GetProductPhotos(p.ID.ToString()).ToList());
this line work good. and i do this with that code
p.Picture = piclist.ToList();
thx..
Mstkk
Member
9 Points
42 Posts
C# Exceptions on the Add to list..
Feb 24, 2013 09:40 PM|LINK
public virtual List<ProductPicture> Picture { get; set; }Rion William...
All-Star
27454 Points
4542 Posts
Re: C# Exceptions on the Add to list..
Feb 24, 2013 10:35 PM|LINK
What datatype is being returned from your GetProductPhotos() method from your Picture Repository?
Have you tried just using a .ToList() following that method?
Mstkk
Member
9 Points
42 Posts
Re: C# Exceptions on the Add to list..
Feb 25, 2013 01:26 PM|LINK
this line work good. and i do this with that code
thx..