public void Edit(AboutMeInputModel model) { var about = this.db.AboutMe.FirstOrDefault(x => x.Id == model.Id); this.db.Entry(about).CurrentValues.SetValues(model); this.db.SaveChanges(); }
public void Add(AboutMeInputModel model) { var aboutMe = new KTaseva.Models.AboutMe { Title = model.Title, Description = model.Description }; this.db.AboutMe.Add(aboutMe); this.db.SaveChanges(); }
public void AddReturnCorrectly() { var model = new AboutMeInputModel { Id = 1 }; this.aboutMeService.Add(model); Assert.Equal(1, this.db.AboutMe.Count()); }