'How to use Option Pattern in side AutoMapper class?

i would like to use Option Pattern in side AutoMapper class but it isn't workig this is the startup.cs

 public void ConfigureServices(IServiceCollection services)
        {
            services.AddAutoMapper(typeof(Startup));
        }

this is the my AutoMapping

 public class AutoMapping : Profile
    {
        private readonly IOptions<AppSettings> _appSettings;
        public AutoMapping(IOptions<AppSettings> appSettings)
        {
            this._appSettings = appSettings;
            
                CreateMap<Hotel, HotelDTO>();
                CreateMap<HotelDTO, Hotel>().ForMember(dest => dest.Id, opt => opt.AllowNull());
             
        }
    }

the mapping is workig well but the IOption gives me internal server error



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source