Kaynak nesne boşsa AutoMapper'ın yeni bir hedef türünü döndürmesi mümkün mü?AutoMapper: source == null ise hedef türün örneklerini oluştur
Source source = null;
Dest d1 = AutoMapper.Mapper.Map<Source, Dest>(source);
// d1 == null
// I'm looking for a way to configure AutoMapper to
// eliminate this code:
Dest d2 = AutoMapper.Mapper.Map<Source, Dest>(source) ?? new Dest();
bir yöntem falan sar Automapper herhangi mülk, ör .: için bazı özel değerine NULL değeri yerine
.NullSubstitute()
kullanabilirsiniz – Omu