public Category Create(CreateCategoryCommand command) { var category = new Category(command.Title); category.Register(); _repository.Create(category); if (Commit()) return category; return null; }
public void AlterarCategoria() { var category = new Category("Placa Mâe"); Assert.AreEqual(true, CategoryScopes.UpdateCategoryScopeIsValid(category, "Modtherboard")); }
public void RegistrarCategoria() { var category = new Category("Placa Mãe"); Assert.AreEqual(true, CategoryScopes.CreateCategoryScopeIsValid(category)); }
public void Update(Category category) { _context.Entry<Category>(category).State = EntityState.Modified; }
public void Delete(Category category) { _context.Categories.Remove(category); }
public void Create(Category category) { _context.Categories.Add(category); }