I have a class in my application
public class ProductInfo { public int ProductId {get;set;} public int ProductType{get;set;} }
I want to write a linq query which can return me a list of ProductIds in a comma separated format where ProductType is equal to certain number ?
I tried using string.join with my Linq statement but it didn't seem to work.
var s = string.Join(",", products.Where(p => p.ProductType == someType) .Select(p => p.ProductId.ToString()));
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With