RBS
asked on
Linq transform field
Hi:
I have a field in a products table that I am trying to transform when it is in a list from "MyPic" to "/Content/Image/MyPic_smal l.png"
The Model is:
The current Linq expression is:
My Pic is found in the field PicUrl. Any help in figuring out how to do this in the Linq expression greatly appreciated.
RBS
I have a field in a products table that I am trying to transform when it is in a list from "MyPic" to "/Content/Image/MyPic_smal
The Model is:
public class Product
{
public int ProductId { get; set; }
public int GenreId { get; set; }
public string Title { get; set; }
public string PicUrl { get; set; }
public virtual Genre Genre { get; set; }
}
The current Linq expression is:
var genreModel = storeDB.Genres.Include("Products")
.Single(g => g.Name == genre);
My Pic is found in the field PicUrl. Any help in figuring out how to do this in the Linq expression greatly appreciated.
RBS
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Not a problem, glad to help.
ASKER
Thanks for your response - I'm afraid I found a quick solution and then went off and did other things - and well, dropped the ball. I think looking back on it now that I probably need to create a dto but for now don't have time and my quick solution is working.
Regards,
RBS