Esempio n. 1
0
        public void Save(int id, string name)
        {
            Contract.Requires <ArgumentException>(!string.IsNullOrWhiteSpace(name));
            Contract.Requires <ArgumentException>(!Exists(name), $"Income category '{name}' is already defined");

            var category = new IncomeCategory {
                Id = id, Name = name
            };

            _repository.Save(category);
        }
Esempio n. 2
0
 public void Save(IncomeCategory category)
 {
     _repository.Save(category);
 }