I am creating a c# library that uses service references. I don't want the entire service to be accessible outside the library. So I first used AutoMapper to copy the service classes that I needed in to similar classes in my library. The second step was to make the service references internal. My main problem now is that there doesn't seem to be any auto mapping libraries that support internal access. I've tried AutoMapper, EmitMapper, and ValueInjecter libraries and all my copied objects have null/default values. AutoMapper has a github issue related to supporting internal, but there is no indication of when we will see it.
I've decided to try something oddball which was to Serialize the service class using JSON.NET and then to Deserialize it in to the library class. This works pretty well but I wonder how this compares to libraries like AutoMapper in terms of performance. I know that EmitMapper is king as far as performance.
Has anyone found an auto mapping solution that works for internals?