Exemplo n.º 1
0
        // GET: api/Developer
        /// <summary>
        /// Get all developers
        /// </summary>
        public IHttpActionResult Get()
        {
            var model = DeveloperRepository.GetAll().Select(a => new DeveloperViewModel {
                Firstname = a.Firstname, Lastname = a.Lastname, Email = a.Email, Category = a.Category.Name, Id = a.Id
            });

            return(Ok(model));
        }
        public void TestDeveloperRepo_GetAll()
        {
            //Arrange
            DeveloperRepository TestRepo = CreateDeveloperTestRepo("DeveloperGetAll");

            //Act
            var result = TestRepo.GetAll();

            //Assert
            Assert.IsTrue(result.Count() == _DeveloperNumber);
        }
Exemplo n.º 3
0
        public async Task <ActionResult <List <Developer> > > GetAll()
        {
            var result = await _developerRepository.GetAll();

            if (result == null)
            {
                return(NotFound());
            }

            var reply = result.Select(r => new Developer(r, t => Imager.GenerateDeveloperImageUrl(Request, r.Path)));

            return(Ok(reply));
        }