using System.Collections.Generic;
public string? Name { get; set; }
public string? Phone { get; set; }
public string? Address { get; set; }
public string? Email { get; set; }
public string? WorkPhone { get; set; }
public static void Main()
var personProperty = "e_mail";
var propertyValue = "123@abc.com";
var valueAssignmentByPersonProperty = new Dictionary<string, Func<Person, string, string>>
["title"] = (person, newValue) => person.Name = newValue,
["phone"] = (person, newValue) => person.Phone = newValue,
["address"] = (person, newValue) => person.Address = newValue,
["e_mail"] = (person, newValue) => person.Email = newValue,
["work_phone"] = (person, newValue) => person.WorkPhone = newValue,
var personA = new Person();
if (valueAssignmentByPersonProperty.TryGetValue(personProperty, out var assignValueDelegate))
assignValueDelegate(personA, propertyValue);
Console.WriteLine("Name: " + personA.Name);
Console.WriteLine("Phone: " + personA.Phone);
Console.WriteLine("Address: " + personA.Address);
Console.WriteLine("Email: " + personA.Email);
Console.WriteLine("WorkPhone: " + personA.WorkPhone);