How to write below logic in Generic way?
I have a model like below public sealed class Person { public string MobileNo { get; set; } public string Firstname { get; set; } public string Lastname { get; set; } } In my implmentation class, I have a method which takes an IEnumerable as a parameter public string PersonList(string listName, IEnumerable<Person> persons) { dictionary.Add("name", new String[1] { listname }); dictionary.Add("list", persons.ToArray()); PrivateMethod("personList", dictionary); } I have another private method private string PrivateMethod(string value, Dictionary<string, object[]> parameters) { foreach