मेरे पास कुछ एएसपी.Net ऐप्स हैं जो मैपिंग कोड साझा करते हैं, इसलिए मैंने एक सामान्य ऑटोमैपर इनिट क्लास बनाया है।आरंभ करने के बाद ऑटोमैपर में मैपिंग कैसे जोड़ सकता हूं?
हालांकि, मेरे ऐप्स में से एक में, मेरे पास कुछ विशिष्ट वर्ग हैं जिन्हें मैं कॉन्फ़िगरेशन में जोड़ना चाहता हूं।
मैं निम्नलिखित कोड:
public class AutoMapperMappings
{
public static void Init()
{
AutoMapper.Mapper.Initialize(cfg =>
{
... A whole bunch of mappings here ...
}
}
}
और
// Call into the global mapping class
AutoMapperMappings.Init();
// This erases everything
AutoMapper.Mapper.Initialize(cfg => cfg.CreateMap<CustomerModel, CustomerInfoModel>());
मैं नष्ट क्या पहले से ही आरंभ नहीं हो जाता बिना इस अनूठी मानचित्रण कैसे जोड़ सकता हूँ?