This is my integer array with Ids
GoalIds{int[7]}
[0]: 31935
[1]: 31940
[2]: 31976
[3]: 31993
[4]: 31994
[5]: 31995
[6]: 31990
I am getting the above array from this code
Array GoalIds = FilteredEmpGoals.Select(x => x.GoalId).Distinct().ToArray();
I am trying to convert it to comma separated string like
31935, 31940, 31976, 31993, 31994, 31995, 31990
To achieve this I tried
var result = string.Join(",", GoalIds);
but its's giving me "System.Int32[]"
in result.
Please let me update where I make a mistake here.
Ref: I looked at here and the example is working fine from there.
UPDATE
REF: As @paqogomez suggested
I was trying to store the values in a Array but may be it was not handling the values correctly. Now I did change the code for making the array as below
int[] GoalIds = FilteredEmpGoals.Select(x => x.GoalId).Distinct().ToArray();
Now it's working fine for me.