Пример #1
0
        public List <TypeDomainModel> GetTypes()
        {
            List <TypeDomainModel> list = tRep.GetAll().Select(m => new TypeDomainModel {
                ID = m.ID, Description = m.Description, Type = m.Type
            }).ToList();

            return(list);
        }
        public void Create()
        {
            //Arrange
            Type item = new Type()
            {
                Description = "test",
                Status      = "test"
            };

            //Act
            repository.Create(item);
            context.SaveChanges();
            var result = repository.GetAll().ToList();

            //Assert
            Assert.IsNotNull(result);
            Assert.IsInstanceOfType(result, typeof(IEnumerable <Type>));
            Assert.AreEqual(4, result.Count);
            Assert.AreEqual(4, result.Last().ID);
            Assert.AreEqual(item, result.Last());
        }
 public List <Type> GetAll()
 {
     return(_typeRepository.GetAll());
 }
Пример #4
0
        public IActionResult GetAll()
        {
            var typeList = typeRepository.GetAll();

            return(Ok(typeList));
        }