Where to set automapper configuration for webservice?

I read that the web service does not have global.asax for setting global parameters (e.g. automapper configuration). So my question is:

Should I put the automapper configuration in every web method or is there a place that I can place globally?

I'm going to call the internet service a couple of thousand times every night, so I'm worried that if the automapper configuration is expensive, it will take much longer. Am I correcting or just worrying about what I need?

thanks John

+4
source share
1 answer

AutoMapper configuration is expensive, yes. I do a lot of time optimizations to get things done quickly. If you use ASMX web services, you can still use global.asax, since ASMX is still hosted only in ASP.NET.

If it is a WCF, then it will depend on how you host the WCF. Send this message for your options:

http://blogs.msdn.com/wenlong/archive/2006/01/11/511514.aspx

+5
source

Source: https://habr.com/ru/post/1302808/


All Articles