public ChefController() { _chefService = new ChefService(); var mapperConfig = new MapperConfiguration(cfg => { var map = cfg.CreateMap <UserPostModel, UserModel>(); cfg.CreateMap <ChefPostModel, ChefModel>(); cfg.CreateMap <CateringOrderPostModel, CateringOrderModel>(); cfg.CreateMap <UserModel, UserViewModel>(); cfg.CreateMap <ChefModel, ChefViewModel>(); cfg.CreateMap <CateringOrderModel, CateringOrderViewModel>(); }); _mapper = new Mapper(mapperConfig); }