I have a list of objects, Model is:
public class Rule
{
public bool IsValid { get; set; }
public string RuleName { get; set; }
public string Description { get; set; }
}
To get values of RuleName and IsValid from a list of Rules I did the following:
string.Join(", ", list.Select(rule=> new { rule.RuleName, rule.IsValid }))
Current output is in the following format:
{ RuleName = name1, IsValid = True}, { RuleName = name2, IsValid = False }
How to convert it to a format similar to the following without using loops?
name1 is True, name2 is False