public async Task <IActionResult> Edit(int id, [Bind("ListingId,Date")] SummaryReviews summaryReviews) { if (id != summaryReviews.ListingId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(summaryReviews); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!SummaryReviewsExists(summaryReviews.ListingId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(summaryReviews)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,ListingUrl,ScrapeId,LastScraped,Name,Summary,Space,Description,ExperiencesOffered,NeighborhoodOverview,Notes,Transit,Access,Interaction,HouseRules,ThumbnailUrl,MediumUrl,PictureUrl,XlPictureUrl,HostId,HostUrl,HostName,HostSince,HostLocation,HostAbout,HostResponseTime,HostResponseRate,HostAcceptanceRate,HostIsSuperhost,HostThumbnailUrl,HostPictureUrl,HostNeighbourhood,HostListingsCount,HostTotalListingsCount,HostVerifications,HostHasProfilePic,HostIdentityVerified,Street,Neighbourhood,NeighbourhoodCleansed,NeighbourhoodGroupCleansed,City,State,Zipcode,Market,SmartLocation,CountryCode,Country,Latitude,Longitude,IsLocationExact,PropertyType,RoomType,Accommodates,Bathrooms,Bedrooms,Beds,BedType,Amenities,SquareFeet,Price,WeeklyPrice,MonthlyPrice,SecurityDeposit,CleaningFee,GuestsIncluded,ExtraPeople,MinimumNights,MaximumNights,CalendarUpdated,HasAvailability,Availability30,Availability60,Availability90,Availability365,CalendarLastScraped,NumberOfReviews,FirstReview,LastReview,ReviewScoresRating,ReviewScoresAccuracy,ReviewScoresCleanliness,ReviewScoresCheckin,ReviewScoresCommunication,ReviewScoresLocation,ReviewScoresValue,RequiresLicense,License,JurisdictionNames,InstantBookable,IsBusinessTravelReady,CancellationPolicy,RequireGuestProfilePicture,RequireGuestPhoneVerification,CalculatedHostListingsCount,ReviewsPerMonth")] Listings listings) { if (id != listings.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(listings); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ListingsExists(listings.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["Id"] = new SelectList(_context.Listings, "Id", "Access", listings.Id); return(View(listings)); }