我在Bootstrapper中configuration了Automapper,我在Application_Start()调用了Bootstrap() ,而且我被告知这是错误的,因为每次我必须添加一个新映射时,必须修改Bootstrapper类,所以我我违反了开放原则。 你怎么看,我真的违反这个原则吗? public static class Bootstrapper { public static void BootStrap() { ModelBinders.Binders.DefaultBinder = new MyModelBinder(); InputBuilder.BootStrap(); ConfigureAutoMapper(); } public static void ConfigureAutoMapper() { Mapper.CreateMap<User, UserDisplay>() .ForMember(o => o.UserRolesDescription, opt => opt.ResolveUsing<RoleValueResolver>()); Mapper.CreateMap<Organisation, OrganisationDisplay>(); Mapper.CreateMap<Organisation, OrganisationOpenDisplay>(); Mapper.CreateMap<OrganisationAddress, OrganisationAddressDisplay>(); } }