c# - AutoMapper generic map method does not map enum values -


i have generic mapper function mapping between view models , domain models. reason, not map enum values.

public tdomainmodel maptodomainmodel<tviewmodel, tdomainmodel>(tviewmodel viewmodel) {     mapper.createmap<tviewmodel, tdomainmodel>();     tdomainmodel result = mapper.map<tviewmodel, tdomainmodel>(viewmodel);     return result; }  public tviewmodel maptoviewmodel<tdomainmodel, tviewmodel>(tdomainmodel domainmodel) {     mapper.createmap<tdomainmodel, tviewmodel>();     tviewmodel result = mapper.map<tdomainmodel, tviewmodel>(domainmodel);     return result; } 

i need map enum values integers when mapping view model domain model. , map integers enum values when mapping domain models view models.

it great if solution flexible enough convert nullable enums more types (short, byte etc) , vice versa.


Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -