public void DeleteCategory(int categoryId) { var category = GetCategoryById(categoryId); _context.Categories.Remove(category); _context.SaveChanges(); }
/// <summary> /// Deletes the period type. /// </summary> /// <param name="periodTypeId">The period type identifier.</param> public void DeletePeriodType(int periodTypeId) { var periodType = GetPeriodTypeById(periodTypeId); _context.PeriodTypes.Remove(periodType); _context.SaveChanges(); }
public void DeleteProduct(int productId) { var product = GetProductById(productId); _context.Products.Remove(product); _context.SaveChanges(); }
/// <summary> /// Deletes the unit type. /// </summary> /// <param name="unitTypeId">The unit type identifier.</param> public void DeleteUnitType(int unitTypeId) { var unitType = GetUnitTypeById(unitTypeId); _context.UnitTypes.Remove(unitType); _context.SaveChanges(); }