Hi,
Is there a way to use ToString() in Lambda.
Query
List<PostViewShoppingCart> scartList = (from s in MongoContext.ShoppingCart.AsQueryable()
join p in MongoContext.Products.AsQueryable() on
s.ProductId equals p._id
where s.UserName == uName
select new PostViewShoppingCart()
{
UserName = s.UserName,
SessionId = s.SessionId, P_id = p._id.ToString(),
ProductDescription = p.ProductDescription,
ProductTitle = p.ProductTitle,
ImageURL = p.ImagePath,
QtyOrdered = s.QtyOrdered,
ProductSKU = p.ProductSku
}).ToList();p._id is type of ObhectId I want to convert it in to string as my model property P_id is type of string. I f I use ToString() as above I get an error . Is there any other way to achieve this?
Thanks