Need to speed up automapper…It takes 32 seconds to do 113 objects

后端 未结 7 2003
[愿得一人]
[愿得一人] 2021-01-30 09:25

Hi I have some major problems with auto mapper and it being slow. I am not sure how to speed it up.

I am using nhibernate,fluent nhibernate and asp.net mvc 3.0



        
7条回答
  •  盖世英雄少女心
    2021-01-30 09:47

    I fixed the same issue as yours. It also costs me 32s for mapping only one object. So, I use opts.Ignore() to deal with some customized object as below:

                CreateMap()
                    .ForMember(x => x.SubSystems, opts => opts.Ignore())
                    .ForMember(x => x.PointInformations, opts => opts.Ignore())
                    .ForMember(x => x.Schedules, opts => opts.Ignore())
                    .ForMember(x => x.EquipmentDefinitions, opts => opts.Ignore());
    

    After that, it just cost a few milliseconds.

提交回复
热议问题