Dynamically build an object from a strongly typed class using C#?
问题 Currently, am adding the properties and values to the object manually like this example and sending to Dapper.SimpleCRUD to fetch data from Dapper Orm. This is the desired output I would like to achieve. object whereCriteria = null; whereCriteria = new { CountryId = 2, CountryName = "Anywhere on Earth", CountryCode = "AOE", IsActive = true }; The following class should build the object in the above mentioned format and return the ready-made object. public static class WhereClauseBuilder {