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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -