hi guys
how do I iterate through a c# class e.g. Basket.cs and append the values to a string builder
this is what I have tried
public async Task<string> AddToBasketAsync(Basket basket)
{
var s = JsonConvert.SerializeObject(basket);
s = s.Replace("\"", ""); // This gets rid of all the "\ and leaves only the values enclosed in brackets
var splitFunction = s.Split(":");
then I have tried to iterate through the s variable and append the values to the StringBuilder class. I know this is a cumbersome way of doing things, hence why I am asking for a better way.
Basically I am trying to get something like this (The values separated by comma)
string basketValues = basket.Username + "," + basket.ProductID + "," + basket.ProductID + "," + basket.Quantity + ",".ToString();
Thanks