//[AcceptVerbs("Get")] public HttpResponseMessage PhoneList() { var items = repository.GetAll(); return(Request.CreateResponse(HttpStatusCode.OK, items.ToList())); }
public List <Phone> GetPhoneListOfPerson(int personId) { /* Used UnitOfWork attribute, because GetAll method returns IQueryable<Phone>, it does not fetches records from database. * No database operation is performed until ToList(). Thus, we need to control connection open/close in this method using UnitOfWork. */ return(_phoneRepository.GetAll().Where(phone => phone.PersonId == personId).ToList()); }
public IEnumerable <Phone> GetAll() { return(_iPhoneRepository.GetAll()); }
public async Task <IActionResult> Index() { return(View(_mapper.Map <PhoneViewModel>(await _phoneRepository.GetAll()))); }
public List <Phone> GetAll() { return(_repository.GetAll()); }
public IEnumerable <Phone> Get() { return(_phoneRepository.GetAll().OrderBy(x => x.FirstName)); }
public IEnumerable <PhoneViewModel> ListPhones() { return(_mapper .Map <IEnumerable <Phone>, IEnumerable <PhoneViewModel> >( _repository.GetAll())); }
//GET: api/Phones public IHttpActionResult Get() { var items = repository.GetAll(); return(Ok(items)); }