コード例 #1
0
        public List <PayingGuestHouse> GetAllPgs()
        {
            var pgs = (from pg in _dbContext.tbl_pgsb_paying_guest_homestay
                       select new PayingGuestHouse
            {
                PGFullName = pg.name,
                AddressLine1 = pg.address_line_1,
                AddressLine2 = pg.address_line_2,
                DetailedDescription = pg.incharge_person_details,
                IsInCharge = !string.IsNullOrEmpty(pg.incharge_id),
                OwnerName = pg.owner_name,
                PhoneNumber = pg.contact_phone_number,
                Email = pg.email_id,
                PGMasterId = Guid.Parse(pg.pg_id),
                //PointOfContact = pg.tbl_pgsb_users.
                Area = new Area(CodeValues.GetCodeValue("Area", pg.area_code), CodeValues.GetCodeValue("pincode", Convert.ToInt32(pg.pin_code))),
                PGType = new PGTypeGenderWise(CodeValues.GetCodeValue("pgtype", pg.pg_type_code)),
                //PointOfContact

                //pg.tbl_pgsb_pg_amenities.ToList().ForEach(
                //a =>
                //{
                //    Amenities.Add(CodeValues.GetCodeValue("PGAmenity", a.amenity_code));
                //}),
            }
                       );

            return(pgs.ToList());
        }