Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Create mapping provider interface and handling code #7

Closed
dclucas opened this issue Apr 4, 2013 · 1 comment
Closed

Feature: Create mapping provider interface and handling code #7

dclucas opened this issue Apr 4, 2013 · 1 comment

Comments

@dclucas
Copy link
Owner

dclucas commented Apr 4, 2013

A user should be able to provide custom mapping for a given Source/Target combination by implementing a simple interface:

public class PersonPersonEditModelMappingProvider : MappingProvider<Person, PersonEditModel>
{
      public void AddMappings()
      {
            this.AddMapping()
               .From(s => s.Name + s.LastName)
               .To(t => t.FullName)
      }
}

The design needs to either have a base class that provides an AddMapping method or to provide an interface that receives a repo (or a new MappingAdder class or such) and uses it. While the interface is more easily testable, the base class enforces a segregation by source/target more easily.

@dclucas dclucas closed this as completed Apr 6, 2013
@dclucas
Copy link
Owner Author

dclucas commented Apr 6, 2013

Implemented in version 0.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant