Exemplo n.º 1
0
        public HttpResponseMessage GetPersonalById(HttpRequestMessage request, int Id)
        {
            PersonalDivisionSection personal = (from per in personalRepo.GetWithoutTracking().Where(a => a.IsDeleted != true && a.PersonalID == Id)
                                                join div in divisionRepo.GetWithoutTracking()
                                                on per.DivisionID equals div.DivisionID
                                                join sec in sectionRepo.GetWithoutTracking()
                                                on per.SectionID equals sec.SectionID
                                                select new PersonalDivisionSection
            {
                persoanl = per,
                division = div,
                section = sec,
            }).FirstOrDefault();
            List <Division> division     = divisionRepo.Get().ToList();
            List <Section>  section      = sectionRepo.Get().ToList();
            PersonalData    personaldata = new PersonalData();

            personaldata.personalDivisionSection = personal;
            personaldata.divisionData            = division;
            personaldata.sectionData             = section;


            return(Request.CreateResponse(HttpStatusCode.OK, personaldata));
        }