From adfd942306481c34c5dfa0f30c22c20bde537b2a Mon Sep 17 00:00:00 2001 From: Vadym Kurachevskyi Date: Fri, 27 Apr 2018 17:17:24 +0300 Subject: [PATCH] Fixed documentation to not have DuplicateTypeMap AddProfiles recieves assembly types and not direct profiles . Fixes DuplicateTypeMapConfigurationException in some cases --- docs/Dependency-injection.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/Dependency-injection.md b/docs/Dependency-injection.md index 65f555a666..05e0be3f6d 100644 --- a/docs/Dependency-injection.md +++ b/docs/Dependency-injection.md @@ -104,11 +104,7 @@ public class MapperProvider var mce = new MapperConfigurationExpression(); mce.ConstructServicesUsing(_container.GetInstance); - var profiles = typeof(SomeProfile).Assembly.GetTypes() - .Where(t => typeof(Profile).IsAssignableFrom(t)) - .ToList(); - - mce.AddProfiles(profiles); + mce.AddProfiles(typeof(SomeProfile).Assembly); var mc = new MapperConfiguration(mce); mc.AssertConfigurationIsValid();