Exemplo n.º 1
0
        public async Task <ActionResult <PeopleListForAngularUI> > SearchForPeople(int pageIndex, int pageSize, string firstName, string lastName, string address, string telephoneNumber)
        {
            // Search for people
            PeopleListForAngularUI people = await peopleBs.SearchForPeopleAsync(pageIndex, pageSize, firstName, lastName, address, telephoneNumber);

            if (people == null) // Error arised on search for people
            {
                this.CreateErrorModelState();
                return(BadRequest(ModelState));
            }
            return(Ok(people));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <PeopleListForAngularUI> > GetPeople(int pageIndex, int pageSize, bool orderByIdDesc)
        {
            // Get all people from the DB
            PeopleListForAngularUI people = new PeopleListForAngularUI(); // since this is an business object with only getter and setters, I decided not to implement DI on it

            people = await peopleBs.GetAllPeopleAsync(pageIndex, pageSize, orderByIdDesc);

            if (people == null) // Error arised on
            {
                this.CreateErrorModelState();
                return(BadRequest(ModelState));
            }
            return(Ok(people));
        }