//------------------------------------------------------------------------------ //update existed data for old user public void Update(RecommencePrice modifiedmodel) { var updateModel = _repo.Get(x => x.UserId == modifiedmodel.UserId); updateModel.ProductRecommencePrices = modifiedmodel.ProductRecommencePrices; _repo.Update(updateModel); _unitOfWork.Save(); }
//Load exist data or new for new user logging public void LoadAndUpdate(RecommencePrice newModel) { var result = CheckAndLoadFromDb(newModel.UserId); if (result == null) { Create(newModel); } else { Update(newModel); } }
//-------------------------------------------------------------------------------- //create new data for new user public void Create(RecommencePrice newModel) { _repo.Create(newModel); _unitOfWork.Save(); }