public void Update(RatingDetailModel model) { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { var entity = RatingMapper.MapRatingDetailModelToEntity(model); dbContext.Ratings.Update(entity); dbContext.SaveChanges(); } }
public RatingDetailModel Create(RatingDetailModel model) { using (var dbContext = _dbContextSqlFactory.CreateDbContext()) { var entity = RatingMapper.MapRatingDetailModelToEntity(model); dbContext.Ratings.Add(entity); dbContext.SaveChanges(); return(RatingMapper.MapRatingEntityToDetailModel(entity)); } }