Beispiel #1
0
        public void Insert(Race race)
        {
            if (race == null)
            {
                throw new Exception("A raça não pode ser nula");
            }

            if (string.IsNullOrEmpty(race.Name))
            {
                throw new Exception("A raça precisa ter Name");
            }

            if (string.IsNullOrEmpty(race.Specie))
            {
                throw new Exception("A raça precisa ter Espécie");
            }

            raceRepository.Insert(race);
        }