Is there a way to place property attributes in an anonymous type? Or an anonymous type? If not, when do you create it, perhaps after reflection?
As a potential use case, let me borrow from Dapper :
When providing parameters to execute a request in Dapper, you specify parameters of an anonymous type:
connection.Query<Foo>(sql, new { Id = guid, Condition = true });
Let's say I needed to tell something about the match, for example, we can store Boolean as text T/ F(terrible, but unfortunately true for real experience), so I want to add to this attribute Conditionto tell Dapper how to match it (again, this is a slightly coercive example). Is it possible?
source
share