public void AddCategory(TestCategoryW cat) { var category = cat.ToBase(); category.Id = Guid.NewGuid(); db.TestCategories.Add(category); db.SaveChanges(); }
public bool IsExisting(TestCategoryW cat) { var founded = db.TestCategories.FirstOrDefault(x => x.Name.ToLower() == cat.Name.ToLower()); if (founded != null) return true; return false; }
public void EditCategory(TestCategoryW cat) { var category = db.TestCategories.Single(c => c.Id == cat.Id); category.Name = cat.Name; db.SaveChanges(); }