Consider:
using AutoMapper;
namespace Payme.Whatever
{
public class FooMapping : Profile
{
public override string ProfileName => GetType.Name;
protected override void Configure()
{
Mapper.CreateMap<Foo, Bar>();
}
}
}
Random thoughts on this...
- I'm not sure what setting the Profile name in AutoMapper's way of doing things gets us.
- protected override is a thing. Think IDisposable.
- This may or may not be a Liskov violation. It depends on the intent of "contract" and would be changes.
- If you do your own thing in an IDisposable pattern and then call base.Dispose() it's not a violation.
- This may or may not be a Liskov violation. It depends on the intent of "contract" and would be changes.
No comments:
Post a Comment