Using string.Split() in AutoMapper issue
问题 I have an ASP .Net core application. I am simply trying to have my AutoMapper configure to convert a string comma delimited into a list of strings as per this configuration: configuration.CreateMap<Job, JobDto>() .ForMember(dto => dto.Keywords, options => options.MapFrom(entity => entity.Keywords.Split(',').ToList())) For some reason it does not get compiled and give me the following error: An expression tree may not contain a call or invocation that uses optional argument I can't see why I