I use AutoMapper in a number of projects in my solution. These projects can be deployed independently on multiple servers.
The documentation for AutoMapper says:
If you use the static Mapper method, the configuration should only occur once in the AppDomain. This means the best place for the configuration code is in the launch application, for example, the Global.asax file for ASP.NET applications.
While some of the projects will be ASP.net - most of them are Windows class / service libraries.
Where should I configure my mappings in this case?
, AppDomain, , . . AutoMapper, IoC (Windsor), , program.cs. , , , , .
, , , , , , .
, .
protected void Application_Start() { RegisterMaps(); } private void RegisterMaps() { WebAutoMapperSettings.Register(); BusinessLogicAutoMapperSettings.Register(); }
, BusinessLogicAutoMapperSettings.Register(), BusinessLogic webservice
Source: https://habr.com/ru/post/1744810/More articles:How do I know which version of Java I use Perl? - javaMany regular expressions on strings - javascriptUsing OpenCV Android Porting - androidhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1744808/twisted-reactor-stops-too-early&usg=ALkJrhgogXg10H4CZVEMeO1LqTWjlJ0u8Agit-gui disagrees with git status: why? - gitThe maximum amount of time that a thread can start? - multithreadingProblems initializing a character array - c ++Windows Azure Worldwide Availability - cloudvbCrLf in a multiline text field appears only when .Trim () is called - asp.netWhere to get Google Search XSD - xmlAll Articles