asp.net - Automapper: Mapping from any type to property of generic type -


lets have following generic type:

class a<t> {    public t value {get; set;} } 

now have these 2 classes:

class source {    public string name {get; set;}    public int age {get; set;} } class destination {    public a<string> name {get; set;}    public a<int> age {get; set;} } 

class source , class destination contain hundres of attributes in current project, , have lot of different types (not string , int, in example). configure automapper, map any type has mapping set property "value" in target type. possible, or have configure mapping type?


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

How to understand 2 main() functions after using uftrace to profile the C++ program? -