This project is read-only.
Moo is an object-to-object multimapper. This means that you can use any combination of mapping strategies (see descriptions below) when mapping from one object to another.
  1. Convention: uses property names and types in the source and target mapping classes to determine what should go where;
  2. Attributes: uses moo-specific mapping attributes to create mapping rules. These attributes can be specified in the source or target class, or even in both;
  3. Configuration: uses mapping configuration sections to create mapping rules;
  4. Manual: allows the use of a fluent-like API to allow the programatical creation of mapping rules;

So, what does the code look like? See below:
// the "source" object is the origin -- info will go from it to the target object
SourceClass source = new SourceClass();
source.Title = "Hello World!";

// this object properties will receive the value in some of souce's during mapping
TargetClass target = new TargetClass();

// using the default repository -- a repository is a placeholder for mappers. That way, expensive mapper creation may happen only once.
MappingRepository repository = MappingRepository.Default;

// creating a mapper through the repository, or getting an existing one, in case one already exists.
// by default, the repository returns a composite mapper, that uses all strategies listed above to discover mapping rules.
BaseMapper<SourceClass, TargetClass> mapper = repository.ResolveMapper<SourceClass, TargetClass>();

// mapping from the source object to the target one.
mapper.Map(source, target);

For quick examples on how to use Moo Mappers, see Samples.

Last edited Jan 30, 2011 at 10:53 PM by dlucas, version 8