public int AddPackage(PackageEntities pe) { var config = new MapperConfiguration(cfg => cfg.CreateMap <PackageEntities, tblPackageDetail>()); IMapper mapper = config.CreateMapper(); tblPackageDetail pa = mapper.Map <PackageEntities, tblPackageDetail>(pe); int PackageId = bookingRepository.AddPackage(pa); return(PackageId); }