// 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); }
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)); }