Prior to this approach, I had some methods that included four or five parameters, so I want to condense the majority of them into an object. The TestOptions() object has additional optional values, like 'name' or 'location'.
I'm having trouble retrieving the object values individually. How can I use the specified values from the TestOptions() object in the Setup() method?
public async Task Test_One()
{
await Setup(new TestOptions() { brand = "Brand1", id = 10 }, new List<string> { "user1@abc.com" });
}
public async Task Setup(object values, List<string> emailAddresses)
{
//Do work here that uses 'brand' and 'id' individually
}
public class TestOptions
{
public string brand
{
get; set;
}
public string id
{
get; set;
}
}
Thank you.