Пример #1
0
        public ResourceType Add(ResourceType newRT)
        {
            ResourceType newType = _resourceTypeRepo.Add(newRT);

            if (newType == null)
            {
                throw new ApplicationException("That resource type already exists. You can't make a duplicate type.");
            }

            return(newType);
        }
Пример #2
0
        public void AddTestResourceTypes()
        {
            if (_resourceTypeRepo.GetAll().Count() > 0)
            {
                return;
            }

            ResourceType testType1 = new ResourceType
            {
                Id   = 1,
                Name = "Cable"
            };

            ResourceType testType2 = new ResourceType
            {
                Id   = 2,
                Name = "Ports"
            };

            _resourceTypeRepo.Add(testType1);
            _resourceTypeRepo.Add(testType2);
        }