public IncomeCategory Create(IncomeCategory incomeCategory) { Contract.Requires <ArgumentException>(incomeCategory != null); Contract.Requires <ArgumentException>(!string.IsNullOrWhiteSpace(incomeCategory.Name)); Contract.Requires <ArgumentException>(!Exists(incomeCategory.Name), $"Income category '{incomeCategory.Name}' is already defined"); _repository.Create(incomeCategory); return(incomeCategory); }
public void AddNewCategory(IncomeCategory category) { _repository.Create(category); }