Пример #1
0
 protected Profile()
 {
     ProfileName = GetType().FullName;
     AllowNullDestinationValues = true;
     ConstructorMappingEnabled  = true;
     IncludeSourceExtensionMethods(typeof(Enumerable).Assembly());
     ShouldMapProperty = p => p.IsPublic();
     ShouldMapField    = f => f.IsPublic;
     _mapMissingTypes  = new ConditionalObjectMapper(ProfileName)
     {
         Conventions = { tp => true }
     };
     _globalIgnore = new List <string>();
     _memberConfigurations.Add(new MemberConfiguration().AddMember <NameSplitMember>().AddName <PrePostfixName>(_ => _.AddStrings(p => p.Prefixes, "Get")));
 }
Пример #2
0
 public static IConditionalObjectMapper Where(this IConditionalObjectMapper self, Func <Type, Type, bool> condition)
 {
     self.Conventions.Add(rc => condition(rc.SourceType, rc.DestinationType));
     return(self);
 }