public void submitAuctionAmont(CurrentAuction prvidedDetails) { GenericRepository <UserAuctionInfo> UserAuctionInfoRepository; using (UnitOfWork unitOfWork = new UnitOfWork()) { UserAuctionInfoRepository = unitOfWork.GetRepoInstance <UserAuctionInfo>(); UserAuctionInfo saveUserAuctionInfo = new UserAuctionInfo(); saveUserAuctionInfo.AuctionAmount = Convert.ToDecimal(prvidedDetails.UserAmount); saveUserAuctionInfo.Timestamp = DateTime.Now; saveUserAuctionInfo.Product = new Product(); //Here we need current product saveUserAuctionInfo.UserDetail = new UserDetail(); //current UserID saveUserAuctionInfo.UserDetail1 = new UserDetail(); //current User Manger UserAuctionInfoRepository.Insert(saveUserAuctionInfo); unitOfWork.SaveChanges(); } }