VivodHotel.cs 753 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace UPtur.Models
  7. {
  8. public partial class Hotel
  9. {
  10. UpPrytovContext DB = new UpPrytovContext();
  11. public string CountryName
  12. {
  13. get
  14. {
  15. return DB.Countries.Where(x => x.Code == CountryCode).Select(x => x.Name).FirstOrDefault();
  16. }
  17. }
  18. public int AmountTours
  19. {
  20. get
  21. {
  22. List<HotelOfTour> HotelForAmount = DB.HotelOfTours.ToList();
  23. HotelForAmount = HotelForAmount.Where(x => x.HotelId == Id).ToList();
  24. return HotelForAmount.Count;
  25. }
  26. }
  27. }
  28. }