Ejemplo n.º 1
0
 public ActionResult Edit(TodoCategoryDTO todoCategory)
 {
     if (ModelState.IsValid)
     {
         _categoryService.Change(todoCategory);
         return(RedirectToAction(nameof(Index)));
     }
     return(View(todoCategory));
 }
Ejemplo n.º 2
0
        public void Change(TodoCategoryDTO dto)
        {
            var entity = _repository.GetById(dto.Id);

            if (entity != null)
            {
                entity.Title   = dto.Title;
                entity.Updated = DateTime.Now;
                _repository.Change(entity);
            }
        }
Ejemplo n.º 3
0
        public void Insert(TodoCategoryDTO dto)
        {
            var entity = new TodoCategory()
            {
                Title   = dto.Title,
                Created = DateTime.Now,
                Updated = DateTime.Now
            };

            _repository.Insert(entity);
        }