This lets you put mapping configuration closer to where it's used, instead of a single file of configuration that becomes impossible to edit/maintain. Profiles allow you to group common configuration and organize mappings by usage. √ DO organize configuration into profiles Inline maps are good for very simple scenarios, but you lose the ease of configuration validation. Mapping configuration should be done once at startup. This is difficult to do now, but do not create configuration for each mapping request. You only need to declare Profile configuration. The extensions package will perform all the scanning and dependency injection registration. √ DO use the package in ASP.NET Core with services.AddAutoMapper(assembly) √ DO initialize AutoMapper once with Mapper.Initialize at AppDomain startup in legacy ASP.NETĪutoMapper's static initialization is designed to build configuration once, and cache it.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |