public int AddSourceAddress(SourceAddressEntities se) { var config = new MapperConfiguration(cfg => cfg.CreateMap <SourceAddressEntities, tblSource>()); IMapper mapper = config.CreateMapper(); tblSource sa = mapper.Map <SourceAddressEntities, tblSource>(se); int SourceId = bookingRepository.AddSourceAddress(sa); return(SourceId); }