Example #1
0
        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();
        }
Example #2
0
        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();
        }
Example #3
0
        public void AddReturnCorrectly()
        {
            var model = new AboutMeInputModel
            {
                Id = 1
            };

            this.aboutMeService.Add(model);

            Assert.Equal(1, this.db.AboutMe.Count());
        }